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

Function computeChamfer

pdal/PDALUtils.cpp:511–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509
510
511double computeChamfer(PointViewPtr srcView, PointViewPtr candView)
512{
513 using namespace Dimension;
514
515 KD3Index &srcIndex = srcView->build3dIndex();
516 KD3Index &candIndex = candView->build3dIndex();
517
518 double sum1(0.0);
519 for (PointRef p : *srcView)
520 {
521 PointIdList indices(1);
522 std::vector<double> sqr_dists(1);
523 candIndex.knnSearch(p, 1, &indices, &sqr_dists);
524 sum1 += sqr_dists[0];
525 }
526
527 double sum2(0.0);
528 for (PointRef q : *candView)
529 {
530 PointIdList indices(1);
531 std::vector<double> sqr_dists(1);
532 srcIndex.knnSearch(q, 1, &indices, &sqr_dists);
533 sum2 += sqr_dists[0];
534 }
535
536 return sum1 + sum2;
537}
538
539
540std::vector<std::string> remoteGlob(const std::string& path)

Callers 2

TESTFunction · 0.85
executeMethod · 0.85

Calls 1

knnSearchMethod · 0.45

Tested by 1

TESTFunction · 0.68