MCPcopy Create free account
hub / github.com/PDAL/PDAL / erodeDiamond

Function erodeDiamond

pdal/private/MathUtils.cpp:298–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298void erodeDiamond(std::vector<double>& data, size_t rows, size_t cols,
299 int iterations)
300{
301 std::vector<double> out(data.size(), (std::numeric_limits<double>::max)());
302 std::array<size_t, 5> idx;
303
304 for (int iter = 0; iter < iterations; ++iter)
305 {
306 for (size_t col = 0; col < cols; ++col)
307 {
308 size_t index = col*rows;
309 for (size_t row = 0; row < rows; ++row)
310 {
311 size_t j = 0;
312 idx[j++] = index+row;
313 if (row > 0)
314 idx[j++] = idx[0]-1;
315 if (row < rows-1)
316 idx[j++] = idx[0]+1;
317 if (col > 0)
318 idx[j++] = idx[0]-rows;
319 if (col < cols-1)
320 idx[j++] = idx[0]+rows;
321 for (size_t i = 0; i < j; ++i)
322 {
323 if (data[idx[i]] < out[index+row])
324 out[index+row] = data[idx[i]];
325 }
326 }
327 }
328 data.swap(out);
329 }
330}
331
332Eigen::MatrixXd pointViewToEigen(const PointView& view)
333{

Callers 4

TESTFunction · 0.85
createZInetMethod · 0.85
progressiveFilterMethod · 0.85
processGroundMethod · 0.85

Calls 2

swapMethod · 0.80
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68