![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <DistanceComputationTools.h>


Classes | |
| struct | Cloud2CloudDistancesComputationParams |
| Cloud-to-cloud "Hausdorff" distance computation parameters. More... | |
| struct | Cloud2MeshDistancesComputationParams |
| Cloud-to-mes distances computation parameters. More... | |
Static Public Member Functions | |
| static int | computeCloud2CloudDistances (GenericIndexedCloudPersist *comparedCloud, GenericIndexedCloudPersist *referenceCloud, Cloud2CloudDistancesComputationParams ¶ms, GenericProgressCallback *progressCb=nullptr, DgmOctree *compOctree=nullptr, DgmOctree *refOctree=nullptr) |
| static int | computeCloud2MeshDistances (GenericIndexedCloudPersist *pointCloud, GenericIndexedMesh *mesh, Cloud2MeshDistancesComputationParams ¶ms, GenericProgressCallback *progressCb=nullptr, DgmOctree *cloudOctree=nullptr) |
| Computes the distance between a point cloud and a mesh. More... | |
| static int | computeApproxCloud2CloudDistance (GenericIndexedCloudPersist *comparedCloud, GenericIndexedCloudPersist *referenceCloud, unsigned char octreeLevel, PointCoordinateType maxSearchDist=0, GenericProgressCallback *progressCb=nullptr, DgmOctree *compOctree=nullptr, DgmOctree *refOctree=nullptr) |
| Computes approximate distances between two point clouds. More... | |
| static ScalarType | computePoint2TriangleDistance (const CCVector3 *P, const GenericTriangle *theTriangle, bool signedDist, CCVector3 *nearestP=nullptr) |
| Computes the distance between a point and a triangle. More... | |
| static ScalarType | computePoint2PlaneDistance (const CCVector3 *P, const PointCoordinateType *planeEquation) |
| Computes the (signed) distance between a point and a plane. More... | |
| static ScalarType | computePoint2LineSegmentDistSquared (const CCVector3 *point, const CCVector3 *start, const CCVector3 *end) |
| Computes the square of the distance between a point and a line segment. More... | |
| static int | computeCloud2ConeEquation (GenericIndexedCloudPersist *cloud, const CCVector3 &coneP1, const CCVector3 &coneP2, const PointCoordinateType coneR1, const PointCoordinateType coneR2, bool signedDistances=true, bool solutionType=false, double *rms=nullptr) |
| Computes the distance between each point in a cloud and a cone. More... | |
| static int | computeCloud2CylinderEquation (GenericIndexedCloudPersist *cloud, const CCVector3 &cylinderP1, const CCVector3 &cylinderP2, const PointCoordinateType cylinderRadius, bool signedDistances=true, bool solutionType=false, double *rms=nullptr) |
| Computes the distance between each point in a cloud and a cylinder. More... | |
| static int | computeCloud2SphereEquation (GenericIndexedCloudPersist *cloud, const CCVector3 &sphereCenter, const PointCoordinateType sphereRadius, bool signedDistances=true, double *rms=nullptr) |
| Computes the distance between each point in a cloud and a sphere. More... | |
| static int | computeCloud2DiscEquation (GenericIndexedCloudPersist *cloud, const CCVector3 &discCenter, const PointCoordinateType discRadius, const SquareMatrix &rotationTransform, bool signedDistances=true, double *rms=nullptr) |
| Computes the distance between each point in a cloud and a disc. More... | |
| static int | computeCloud2PlaneEquation (GenericIndexedCloudPersist *cloud, const PointCoordinateType *planeEquation, bool signedDistances=true, double *rms=nullptr) |
| Computes the distance between each point in a cloud and a plane. More... | |
| static int | computeCloud2RectangleEquation (GenericIndexedCloudPersist *cloud, PointCoordinateType widthX, PointCoordinateType widthY, const SquareMatrix &rotationTransform, const CCVector3 ¢er, bool signedDist=true, double *rms=nullptr) |
| static int | computeCloud2BoxEquation (GenericIndexedCloudPersist *cloud, const CCVector3 &boxDimensions, const SquareMatrix &rotationTransform, const CCVector3 &boxCenter, bool signedDist=true, double *rms=nullptr) |
| static int | computeCloud2PolylineEquation (GenericIndexedCloudPersist *cloud, const Polyline *polyline, double *rms=nullptr) |
| Computes the distance between each point in a cloud and a polyline. More... | |
| static ScalarType | ComputeCloud2PlaneDistance (cloudViewer::GenericCloud *cloud, const PointCoordinateType *planeEquation, ERROR_MEASURES measureType) |
| static ScalarType | ComputeCloud2PlaneRobustMax (GenericCloud *cloud, const PointCoordinateType *planeEquation, float percent) |
| Computes the maximum distance between a point cloud and a plane. More... | |
| static ScalarType | ComputeCloud2PlaneMaxDistance (GenericCloud *cloud, const PointCoordinateType *planeEquation) |
| Computes the maximum distance between a point cloud and a plane. More... | |
| static ScalarType | computeCloud2PlaneDistanceRMS (GenericCloud *cloud, const PointCoordinateType *planeEquation) |
| Computes the Root Mean Square (RMS) distance between a cloud and a plane. More... | |
| static PointCoordinateType | ComputeSquareDistToSegment (const CCVector2 &P, const CCVector2 &A, const CCVector2 &B, bool onlyOrthogonal=false) |
| Returns the (squared) distance from a point to a segment. More... | |
| static bool | computeGeodesicDistances (GenericIndexedCloudPersist *cloud, unsigned seedPointIndex, unsigned char octreeLevel, GenericProgressCallback *progressCb=nullptr) |
| static int | diff (GenericIndexedCloudPersist *comparedCloud, GenericIndexedCloudPersist *referenceCloud, GenericProgressCallback *progressCb=nullptr) |
| static SOReturnCode | synchronizeOctrees (GenericIndexedCloudPersist *comparedCloud, GenericIndexedCloudPersist *referenceCloud, DgmOctree *&comparedOctree, DgmOctree *&referenceOctree, PointCoordinateType maxSearchDist=0, GenericProgressCallback *progressCb=nullptr) |
| Synchronizes (and re-build if necessary) two octrees. More... | |
| static bool | MultiThreadSupport () |
Several entity-to-entity distances computation algorithms (cloud-cloud, cloud-mesh, point-triangle, etc.)
Definition at line 31 of file DistanceComputationTools.h.
Definition at line 418 of file DistanceComputationTools.h.
Error estimators.
| Enumerator | |
|---|---|
| RMS | Root Mean Square error |
| MAX_DIST_68_PERCENT | Max distance @ 68% (1 sigma) |
| MAX_DIST_95_PERCENT | Max distance @ 98% (2 sigmas) |
| MAX_DIST_99_PERCENT | Max distance @ 99% (3 sigmas) |
| MAX_DIST | Max distance |
Definition at line 410 of file DistanceComputationTools.h.
Return codes for DistanceComputationTools::synchronizeOctrees.
| Enumerator | |
|---|---|
| EMPTY_CLOUD | |
| SYNCHRONIZED | |
| DISJOINT | |
| OUT_OF_MEMORY | |
Definition at line 563 of file DistanceComputationTools.h.
|
static |
Computes approximate distances between two point clouds.
This methods uses an exact Distance Transform to approximate the real distances. Therefore, the greater the octree level is (it is used to determine the grid step), the finer the result will be (but more memory and time will be needed).
| comparedCloud | the compared cloud |
| referenceCloud | the reference cloud |
| octreeLevel | the octree level at which to compute the Distance Transform |
| maxSearchDist | max search distance (or any negative value if no max distance is defined) |
| progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
| compOctree | the pre-computed octree of the compared cloud (warning: both octrees must have the same cubical bounding-box - it is automatically computed if 0) |
| refOctree | the pre-computed octree of the reference cloud (warning: both octrees must have the same cubical bounding-box - it is automatically computed if 0) |
Definition at line 3754 of file DistanceComputationTools.cpp.
References cloudViewer::DgmOctree::associatedCloud(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::DgmOctree::getCellCode(), cloudViewer::DgmOctree::getCellCodes(), cloudViewer::DgmOctree::getCellIndexes(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::DgmOctree::getCellSize(), cloudViewer::DgmOctree::getMaxFillIndexes(), cloudViewer::DgmOctree::getMinFillIndexes(), cloudViewer::DgmOctree::getPointsInCellByCellIndex(), cloudViewer::Grid3D< Type >::getValue(), cloudViewer::SaitoSquaredDistanceTransform::initGrid(), max(), cloudViewer::DgmOctree::MAX_OCTREE_LEVEL, min(), octreeLevel, cloudViewer::SaitoSquaredDistanceTransform::propagateDistance(), result, cloudViewer::ReferenceCloud::setPointScalarValue(), cloudViewer::GenericCloud::setPointScalarValue(), cloudViewer::Grid3D< Type >::setValue(), cloudViewer::GenericCloud::size(), cloudViewer::ReferenceCloud::size(), SYNCHRONIZED, synchronizeOctrees(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by ccComparisonDlg::computeApproxDistances(), and ccRegistrationTools::ICP().
|
staticprotected |
Computes the "nearest neighbour distance" without local modeling for all points of an octree cell This method has the generic syntax of a "cellular function" (see DgmOctree::localFunctionPtr). Specific parameters are transmitted via the "additionalParameters" structure. There are 3 additional parameters :
| cell | structure describing the cell on which processing is applied |
| additionalParameters | see method description |
| nProgress | optional (normalized) progress notification (per-point) |
Definition at line 370 of file DistanceComputationTools.cpp.
References cloudViewer::DgmOctree::NearestNeighboursSearchStruct::alreadyVisitedNeighbourhoodSize, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellCenter, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellPos, cloudViewer::DgmOctree::computeCellCenter(), dist(), cloudViewer::DgmOctree::findTheNearestNeighborStartingFromCell(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::ReferenceCloud::getPoint(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::level, cloudViewer::DgmOctree::octreeCell::level, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::maxSearchSquareDistd, NAN_VALUE, nProgress, cloudViewer::NormalizedProgress::oneStep(), params, POINT_VISIBLE, cloudViewer::DgmOctree::octreeCell::points, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::queryPoint, cloudViewer::ReferenceCloud::setPointScalarValue(), cloudViewer::ReferenceCloud::size(), cloudViewer::GenericCloud::testVisibility(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::theNearestPointIndex, cloudViewer::DgmOctree::octreeCell::truncatedCode, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by computeCloud2CloudDistances().
|
staticprotected |
Computes the "nearest neighbour distance" with local modeling for all points of an octree cell This method has the generic syntax of a "cellular function" (see DgmOctree::localFunctionPtr). Specific parameters are transmitted via the "additionalParameters" structure. There are 4 additional parameters :
| cell | structure describing the cell on which processing is applied |
| additionalParameters | see method description |
| nProgress | optional (normalized) progress notification (per-point) |
Definition at line 466 of file DistanceComputationTools.cpp.
References cloudViewer::DgmOctree::NearestNeighboursSearchStruct::alreadyVisitedNeighbourhoodSize, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellCenter, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellPos, cloudViewer::DgmOctree::computeCellCenter(), cloudViewer::LocalModel::computeDistanceFromModelToPoint(), CV_LOCAL_MODEL_MIN_SIZE, cloudViewer::DgmOctree::findNearestNeighborsStartingFromCell(), cloudViewer::DgmOctree::findNeighborsInASphereStartingFromCell(), cloudViewer::DgmOctree::findTheNearestNeighborStartingFromCell(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::DgmOctree::getCellSize(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::ReferenceCloud::getPoint(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::level, cloudViewer::DgmOctree::octreeCell::level, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::maxSearchSquareDistd, min(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::minimalCellsSetToVisit, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::minNumberOfNeighbors, NAN_VALUE, cloudViewer::LocalModel::New(), NO_MODEL, nProgress, cloudViewer::NormalizedProgress::oneStep(), params, cloudViewer::DgmOctree::octreeCell::parentOctree, POINT_VISIBLE, cloudViewer::DgmOctree::octreeCell::points, cloudViewer::DgmOctree::NearestNeighboursSearchStruct::pointsInNeighbourhood, cloudViewer::DgmOctree::NearestNeighboursSphericalSearchStruct::prepare(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::queryPoint, cloudViewer::ReferenceCloud::setPointScalarValue(), cloudViewer::ReferenceCloud::size(), cloudViewer::GenericCloud::testVisibility(), cloudViewer::DgmOctree::NearestNeighboursSearchStruct::theNearestPointIndex, cloudViewer::DgmOctree::octreeCell::truncatedCode, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by computeCloud2CloudDistances().
|
static |
Definition at line 3316 of file DistanceComputationTools.cpp.
References abs(), count, dist(), Vector3Tpl< Type >::dot(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::GenericCloud::setPointScalarValue(), cloudViewer::GenericCloud::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
static |
Computes the "nearest neighbour distance" between two point clouds (formerly named "Hausdorff distance") The main algorithm and its different versions (with or without local modeling) are described in Daniel Girardeau-Montaut's PhD manuscript (Chapter 2, section 2.3). It is the standard way to compare directly two dense (and globally close) point clouds.
| comparedCloud | the compared cloud (the distances will be computed on these points) |
| referenceCloud | the reference cloud (the distances will be computed relatively to these points) |
| params | distance computation parameters |
| progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
| compOctree | the pre-computed octree of the compared cloud (warning: both octrees must have the same cubical bounding-box - it is automatically computed if 0) |
| refOctree | the pre-computed octree of the reference cloud (warning: both octrees must have the same cubical bounding-box - it is automatically computed if 0) |
Definition at line 112 of file DistanceComputationTools.cpp.
References computeCellHausdorffDistance(), computeCellHausdorffDistanceWithLocalModel(), DISJOINT, cloudViewer::GenericCloud::enableScalarField(), cloudViewer::DgmOctree::executeFunctionForAllCellsAtLevel(), cloudViewer::DgmOctree::findBestLevelForComparisonWithOctree(), NAN_VALUE, NO_MODEL, params, result, cloudViewer::GenericCloud::setPointScalarValue(), cloudViewer::GenericCloud::size(), SYNCHRONIZED, and synchronizeOctrees().
Referenced by ccComparisonDlg::computeDistances(), diff(), KNNRegions(), CommandCPS::process(), and cloudViewer::ICPRegistrationTools::Register().
|
static |
Computes the distance between each point in a cloud and a cone.
| cloud | a 3D point cloud | |
| coneP1 | center point associated with the larger radii | |
| coneP2 | center point associated with the smaller radii | |
| coneR1 | cone radius at coneP1 (larger) | |
| coneR2 | cone radius at coneP2 (smaller) | |
| signedDist | whether to compute the signed or positive (absolute) distance (optional) | |
| solutionType | if true the scalar field will be set to which solution was selected 1-4 (optional) | |
| [out] | rms | will be set with the Root Mean Square (RMS) distance between a cloud and a cylinder (optional) |
Definition at line 2899 of file DistanceComputationTools.cpp.
References abs(), count, Vector3Tpl< Type >::dot(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericIndexedCloud::getPoint(), min(), Vector3Tpl< Type >::norm2d(), Vector3Tpl< Type >::normalize(), Vector3Tpl< Type >::normd(), cloudViewer::GenericCloud::setPointScalarValue(), and cloudViewer::GenericCloud::size().
|
static |
Computes the distance between each point in a cloud and a cylinder.
| cloud | a 3D point cloud | |
| cylinderP1 | center bottom point | |
| cylinderP2 | center top point | |
| cylinderRadius | cylinder radius | |
| signedDist | whether to compute the signed or positive (absolute) distance (optional) | |
| solutionType | if true the scalar field will be set to which solution was selected 1-4 (optional) | |
| [out] | rms | will be set with the Root Mean Square (RMS) distance between a cloud and a cylinder (optional) |
Definition at line 3061 of file DistanceComputationTools.cpp.
References abs(), count, Vector3Tpl< Type >::dot(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericIndexedCloud::getPoint(), min(), Vector3Tpl< Type >::norm2d(), Vector3Tpl< Type >::normalize(), Vector3Tpl< Type >::normd(), cloudViewer::GenericCloud::setPointScalarValue(), and cloudViewer::GenericCloud::size().
|
static |
Computes the distance between each point in a cloud and a disc.
| cloud | a 3D point cloud | |
| discCenter | disc 3d center point | |
| discRadius | disc radius | |
| rotationTransform | rotation transformation matrix | |
| signedDistances | whether to compute the signed or positive (absolute) distance (optional) | |
| [out] | rms | will be set with the Root Mean Square (RMS) distance between a cloud and a disc (optional) |
Definition at line 3413 of file DistanceComputationTools.cpp.
References abs(), count, dot(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericIndexedCloud::getPoint(), normal, cloudViewer::GenericCloud::setPointScalarValue(), and cloudViewer::GenericCloud::size().
|
static |
Computes the distance between a point cloud and a mesh.
The algorithm, inspired from METRO by Cignoni et al., is described in Daniel Girardeau-Montaut's PhD manuscript (Chapter 2, section 2.2). It is the general way to compare a point cloud with a triangular mesh.
| pointCloud | the compared cloud (the distances will be computed on these points) |
| mesh | the reference mesh (the distances will be computed relatively to its triangles) |
| params | parameters |
| progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
| cloudOctree | the pre-computed octree of the compared cloud (warning: its bounding box should be equal to the union of both point cloud and mesh bbs and it should be cubical - it is automatically computed if 0) |
Definition at line 2498 of file DistanceComputationTools.cpp.
References applySqrtToPointDist(), cloudViewer::DgmOctree::build(), computeCloud2MeshDistanceWithOctree(), cloudViewer::OctreeAndMeshIntersection::distanceTransform, cloudViewer::GenericCloud::enableScalarField(), cloudViewer::utility::floor(), cloudViewer::GenericCloud::forEach(), cloudViewer::GenericCloud::getBoundingBox(), cloudViewer::GenericMesh::getBoundingBox(), cloudViewer::DgmOctree::getOctreeMaxs(), cloudViewer::DgmOctree::getOctreeMins(), cloudViewer::SaitoSquaredDistanceTransform::initGrid(), intersectMeshWithOctree(), cloudViewer::CCMiscTools::MakeMinAndMaxCubical(), max(), cloudViewer::OctreeAndMeshIntersection::maxFillIndexes, cloudViewer::OctreeAndMeshIntersection::mesh, min(), cloudViewer::OctreeAndMeshIntersection::minFillIndexes, cloudViewer::OctreeAndMeshIntersection::octree, octree, params, cloudViewer::OctreeAndMeshIntersection::perCellTriangleList, cloudViewer::SaitoSquaredDistanceTransform::propagateDistance(), result, cloudViewer::ScalarFieldTools::SetScalarValueToNaN(), cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), Tuple3Tpl< Type >::u, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by ccComparisonDlg::computeApproxDistances(), ccComparisonDlg::computeDistances(), ccRegistrationTools::ICP(), and cloudViewer::ICPRegistrationTools::Register().
|
staticprotected |
Computes the distances between a point cloud and a mesh projected into a grid structure This method is used by computeCloud2MeshDistances, after intersectMeshWithOctree has been called.
| octree | the cloud octree |
| intersection | a specific structure corresponding the intersection of the mesh with the grid |
| params | parameters |
| progressCb | the client method can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
Definition at line 2252 of file DistanceComputationTools.cpp.
References cloudViewer::DgmOctree::associatedCloud(), ComputeMaxNeighborhoodLength(), ComputeNeighborhood2MeshDistancesWithOctree(), count, cloudViewer::OctreeAndMeshIntersection::distanceTransform, cloudViewer::DgmOctree::getCellCodesAndIndexes(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::DgmOctree::getCellSize(), cloudViewer::DgmOctree::getPointsInCellByCellIndex(), cloudViewer::Grid3D< Type >::getValue(), cloudViewer::OctreeAndMeshIntersection::mesh, cloudViewer::OctreeAndMeshIntersection::minFillIndexes, nProgress, octree, cloudViewer::NormalizedProgress::oneStep(), params, cloudViewer::OctreeAndMeshIntersection::perCellTriangleList, result, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::ReferenceCloud::setPointScalarValue(), cloudViewer::GenericCloud::size(), cloudViewer::ReferenceCloud::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::textCanBeEdited(), and cloudViewer::GenericProgressCallback::update().
|
staticprotected |
Computes the distances between a point cloud and a mesh projected into a grid structure This method is used by computeCloud2MeshDistances, after intersectMeshWithOctree has been called.
| theIntersection | a specific structure corresponding the intersection of the mesh with the grid |
| params | parameters |
| progressCb | the client method can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
Definition at line 1429 of file DistanceComputationTools.cpp.
References abs(), cloudViewer::DgmOctree::associatedCloud(), ComparePointsAndTriangles(), cloudViewer::DgmOctree::computeCellCenter(), ComputeMaxNeighborhoodLength(), cloudViewer::DgmOctree::ComputeMinDistanceToCellBorder(), count, dist(), cloudViewer::OctreeAndMeshIntersection::distanceTransform, cloudViewer::DgmOctree::getCellCodesAndIndexes(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::DgmOctree::getCellSize(), cloudViewer::ReferenceCloud::getPointPersistentPtr(), cloudViewer::DgmOctree::getPointsInCellByCellIndex(), cloudViewer::Grid3D< Type >::getValue(), cloudViewer::TriangleList::indexes, max(), cloudViewer::OctreeAndMeshIntersection::maxFillIndexes, cloudViewer::OctreeAndMeshIntersection::mesh, min(), cloudViewer::OctreeAndMeshIntersection::minFillIndexes, nProgress, cloudViewer::OctreeAndMeshIntersection::octree, octree, cloudViewer::NormalizedProgress::oneStep(), params, cloudViewer::OctreeAndMeshIntersection::perCellTriangleList, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::ReferenceCloud::setPointScalarValue(), cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), cloudViewer::ReferenceCloud::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::textCanBeEdited(), Tuple3Tpl< Type >::u, cloudViewer::GenericProgressCallback::update(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by computeCloud2MeshDistances().
|
static |
Computes the "distance" (see ERROR_MEASURES) between a point cloud and a plane
| cloud | a point cloud |
| planeEquation | plane equation: [a,b,c,d] as 'ax+by+cz=d' |
| measureType | measure type |
Definition at line 3651 of file DistanceComputationTools.cpp.
References computeCloud2PlaneDistanceRMS(), ComputeCloud2PlaneMaxDistance(), ComputeCloud2PlaneRobustMax(), MAX_DIST, MAX_DIST_68_PERCENT, MAX_DIST_95_PERCENT, MAX_DIST_99_PERCENT, NAN_VALUE, and RMS.
Referenced by ComputeCellStats(), FastMarchingForFacetExtraction::computeTCoefApprox(), ccKdTreeForFacetExtraction::FuseCells(), and cloudViewer::TrueKdTree::split().
|
static |
Computes the Root Mean Square (RMS) distance between a cloud and a plane.
Sums the squared distances between each point of the cloud and the plane, then computes the mean value. WARNING: this method uses the cloud global iterator
| cloud | a point cloud |
| planeEquation | plane equation: [a,b,c,d] as 'ax+by+cz=d' |
Definition at line 3534 of file DistanceComputationTools.cpp.
References abs(), count, cloudViewer::GenericCloud::getNextPoint(), cloudViewer::LessThanEpsilon(), NAN_VALUE, PC_ONE, cloudViewer::GenericCloud::placeIteratorAtBeginning(), cloudViewer::GenericCloud::size(), Tuple3Tpl< Type >::u, Vector3Tpl< PointCoordinateType >::vdot(), and Vector3Tpl< PointCoordinateType >::vnorm2().
Referenced by ComputeCloud2PlaneDistance().
|
static |
Computes the distance between each point in a cloud and a plane.
| cloud | a 3D point cloud | |
| planeEquation | plane equation: [a,b,c,d] as 'ax+by+cz=d' with norm(a,bc)==1 | |
| signedDist | whether to compute the signed or positive (absolute) distance (optional) | |
| [out] | rms | will be set with the Root Mean Square (RMS) distance between a cloud and a plane (optional) |
Definition at line 3187 of file DistanceComputationTools.cpp.
References abs(), count, cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::LessThanEpsilon(), PC_ONE, cloudViewer::GenericCloud::setPointScalarValue(), cloudViewer::GenericCloud::size(), Tuple3Tpl< Type >::u, Vector3Tpl< PointCoordinateType >::vdotd(), and Vector3Tpl< PointCoordinateType >::vnorm2().
|
static |
Computes the maximum distance between a point cloud and a plane.
WARNING: this method uses the cloud global iterator
| cloud | a point cloud |
| planeEquation | plane equation: [a,b,c,d] as 'ax+by+cz=d' |
Definition at line 3620 of file DistanceComputationTools.cpp.
References abs(), count, cloudViewer::GenericCloud::getNextPoint(), cloudViewer::LessThanEpsilon(), max(), NAN_VALUE, PC_ONE, cloudViewer::GenericCloud::placeIteratorAtBeginning(), cloudViewer::GenericCloud::size(), Tuple3Tpl< Type >::u, Vector3Tpl< PointCoordinateType >::vdot(), and Vector3Tpl< PointCoordinateType >::vnorm2().
Referenced by ComputeCloud2PlaneDistance().
|
static |
Computes the maximum distance between a point cloud and a plane.
WARNING: this method uses the cloud global iterator
| cloud | a point cloud |
| planeEquation | plane equation: [a,b,c,d] as 'ax+by+cz=d' |
| percent | percentage of lowest values ignored |
Definition at line 3566 of file DistanceComputationTools.cpp.
References abs(), cloudViewer::utility::ceil(), count, cloudViewer::GenericCloud::getNextPoint(), cloudViewer::LessThanEpsilon(), NAN_VALUE, PC_ONE, cloudViewer::GenericCloud::placeIteratorAtBeginning(), cloudViewer::GenericCloud::size(), std::swap(), Tuple3Tpl< Type >::u, Vector3Tpl< PointCoordinateType >::vdot(), and Vector3Tpl< PointCoordinateType >::vnorm2().
Referenced by ComputeCloud2PlaneDistance().
|
static |
Computes the distance between each point in a cloud and a polyline.
| cloud | a 3D point cloud | |
| polyline | the polyline to measure to | |
| [out] | rms | will be set with the Root Mean Square (RMS) distance between a cloud and a plane (optional) |
Definition at line 3471 of file DistanceComputationTools.cpp.
References computePoint2LineSegmentDistSquared(), count, cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::ReferenceCloud::getPoint(), cloudViewer::GreaterThanEpsilon(), min(), NAN_VALUE, cloudViewer::GenericCloud::setPointScalarValue(), cloudViewer::GenericCloud::size(), cloudViewer::ReferenceCloud::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
static |
Definition at line 3235 of file DistanceComputationTools.cpp.
References count, dist(), Vector3Tpl< Type >::dot(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericIndexedCloud::getPoint(), Vector3Tpl< Type >::norm2(), cloudViewer::GenericCloud::setPointScalarValue(), and cloudViewer::GenericCloud::size().
|
static |
Computes the distance between each point in a cloud and a sphere.
| cloud | a 3D point cloud | |
| sphereCenter | sphere 3d center point | |
| sphereRadius | sphere radius | |
| signedDist | whether to compute the signed or positive (absolute) distance (optional) | |
| [out] | rms | will be set with the Root Mean Square (RMS) distance between a cloud and a sphere (optional) |
Definition at line 3153 of file DistanceComputationTools.cpp.
References abs(), count, cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::GenericCloud::setPointScalarValue(), and cloudViewer::GenericCloud::size().
|
static |
Computes geodesic distances over a point cloud "surface" (starting from a seed point) This method uses the FastMarching algorithm. Thereofre it needs an octree level as input parameter in order to create the corresponding 3D grid. The greater this level is, the finer the result will be, but more memory will be required as well. Moreover to get an interesting result the cells size should not be too small (the propagation will be stoped more easily on any encountered 'hole').
| cloud | the point cloud |
| seedPointIndex | the index of the point from where to start the propagation |
| octreeLevel | the octree at which to perform the Fast Marching propagation |
| progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
Definition at line 3680 of file DistanceComputationTools.cpp.
References cloudViewer::DgmOctree::build(), cloudViewer::GenericCloud::enableScalarField(), cloudViewer::GenericCloud::forEach(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint(), cloudViewer::FastMarchingForPropagation::init(), octree, octreeLevel, cloudViewer::FastMarchingForPropagation::propagate(), result, cloudViewer::FastMarchingForPropagation::setPropagationTimingsAsDistances(), cloudViewer::ScalarFieldTools::SetScalarValueToNaN(), cloudViewer::FastMarching::setSeedCell(), and cloudViewer::GenericCloud::size().
|
static |
Computes the square of the distance between a point and a line segment.
| point | a 3D point |
| start | the start of line segment |
| end | the end of line segment |
Definition at line 2870 of file DistanceComputationTools.cpp.
References Vector3Tpl< Type >::dot(), and Vector3Tpl< Type >::norm2().
Referenced by computeCloud2PolylineEquation().
|
staticprotected |
Computes the distances between a point and a mesh projected into a grid structure
| P | the point |
| distance | the output distance |
| intersection | a specific structure corresponding the intersection of the mesh with the grid |
| params | parameters |
Definition at line 2170 of file DistanceComputationTools.cpp.
References cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::ReferenceCloud::addPointIndex(), ComputeMaxNeighborhoodLength(), ComputeNeighborhood2MeshDistancesWithOctree(), cloudViewer::OctreeAndMeshIntersection::distanceTransform, cloudViewer::PointCloudTpl< T >::enableScalarField(), cloudViewer::DgmOctree::getCellSize(), cloudViewer::PointCloudTpl< T >::getPointScalarValue(), cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint(), cloudViewer::OctreeAndMeshIntersection::mesh, NAN_VALUE, cloudViewer::OctreeAndMeshIntersection::octree, octree, params, cloudViewer::ReferenceCloud::reserve(), cloudViewer::PointCloudTpl< T >::reserve(), result, and cloudViewer::PointCloudTpl< T >::setPointScalarValue().
|
static |
Computes the (signed) distance between a point and a plane.
| P | a 3D point |
| planeEquation | plane equation: [a,b,c,d] as 'ax+by+cz=d' with norm(a,bc)==1 |
Definition at line 2858 of file DistanceComputationTools.cpp.
References abs(), PC_ONE, Tuple3Tpl< Type >::u, Vector3Tpl< PointCoordinateType >::vdot(), and Vector3Tpl< PointCoordinateType >::vnorm().
Referenced by cloudViewer::CloudSamplingTools::applyNoiseFilterAtLevel(), LSLocalModel::computeDistanceFromModelToPoint(), cloudViewer::Neighbourhood::computeRoughness(), ccCompass::estimateStructureNormals(), qM3C2Tools::GuessBestParams(), and ccMeasurementDevice::measurePointToPlaneDistance().
|
static |
Computes the distance between a point and a triangle.
WARNING: if not signed, the returned distance is SQUARED!
| P | a 3D point |
| theTriangle | a 3D triangle |
| signedDist | whether to compute the signed or positive (SQUARED) distance |
| nearestP | optional: returns the nearest point on the triangle |
Definition at line 2668 of file DistanceComputationTools.cpp.
References cloudViewer::GenericTriangle::_getA(), cloudViewer::GenericTriangle::_getB(), cloudViewer::GenericTriangle::_getC(), a00, a01, a11, Vector3Tpl< Type >::cross(), Vector3Tpl< Type >::dot(), Vector3Tpl< PointCoordinateType >::fromArray(), Tuple3Tpl< Type >::u, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by ComparePointsAndTriangles(), and DelaunayLocalModel::computeDistanceFromModelToPoint().
|
static |
Returns the (squared) distance from a point to a segment.
| P | 3D point |
| A | first point of the segment |
| B | first point of the segment |
| onlyOrthogonal | computes distance only if P lies 'in front' of AB (returns -1.0 otherwise) |
Definition at line 3897 of file DistanceComputationTools.cpp.
References Vector2Tpl< Type >::dot(), dot(), Vector2Tpl< Type >::norm2(), and PC_ONE.
|
static |
Computes the differences between two scalar fields associated to equivalent point clouds The compared cloud should be smaller or equal to the reference cloud. Its points should be at the same position in space as points in the other cloud. The algorithm simply computes the difference between the scalar values associated to each couple of equivalent points.
| comparedCloud | the compared cloud |
| referenceCloud | the reference cloud |
| progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
Definition at line 3720 of file DistanceComputationTools.cpp.
References computeCloud2CloudDistances(), cloudViewer::GenericCloud::getPointScalarValue(), cloudViewer::ReferenceCloud::getPointScalarValue(), cloudViewer::DgmOctree::MAX_OCTREE_LEVEL, NAN_VALUE, params, result, cloudViewer::GenericCloud::setPointScalarValue(), cloudViewer::GenericCloud::size(), and cloudViewer::ScalarField::ValidValue().
|
staticprotected |
Intersects a mesh with a grid structure.
This method is used by computeCloud2MeshDistances.
| theIntersection | a specific structure to store the result of the intersection |
| octreeLevel | the octree subdivision level corresponding to the grid |
| progressCb | the client method can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
Definition at line 741 of file DistanceComputationTools.cpp.
References cloudViewer::GenericTriangle::_getA(), cloudViewer::GenericTriangle::_getB(), cloudViewer::GenericTriangle::_getC(), cloudViewer::GenericMesh::_getNextTriangle(), cloudViewer::utility::ceil(), CellToTest::cellSize, cloudViewer::DgmOctree::computeCellCenter(), Vector3Tpl< Type >::cross(), cloudViewer::OctreeAndMeshIntersection::distanceTransform, Vector3Tpl< Type >::dot(), cloudViewer::DgmOctree::getCellSize(), cloudViewer::DgmOctree::getOctreeMins(), cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint(), cloudViewer::GreaterThanEpsilon(), CellToTest::level, max(), cloudViewer::OctreeAndMeshIntersection::maxFillIndexes, cloudViewer::OctreeAndMeshIntersection::mesh, min(), cloudViewer::OctreeAndMeshIntersection::minFillIndexes, Vector3Tpl< Type >::norm2(), nProgress, cloudViewer::OctreeAndMeshIntersection::octree, octree, octreeLevel, cloudViewer::OctreeAndMeshIntersection::perCellTriangleList, cloudViewer::GenericMesh::placeIteratorAtBeginning(), CellToTest::pos, cloudViewer::TriangleList::push(), result, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::Grid3D< Type >::setValue(), cloudViewer::GenericMesh::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::textCanBeEdited(), cloudViewer::CCMiscTools::TriBoxOverlap(), Tuple3Tpl< Type >::u, cloudViewer::GenericProgressCallback::update(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by computeCloud2MeshDistances().
|
static |
Returns whether multi-threading (parallel) computation is supported or not
Definition at line 104 of file DistanceComputationTools.cpp.
|
static |
Synchronizes (and re-build if necessary) two octrees.
Initializes the octrees before computing the distance between two clouds. Check if both octree have the same sizes and limits (in 3D) and rebuild them if necessary.
| comparedCloud | the cloud corresponding to the first octree |
| referenceCloud | the cloud corresponding to the second octree |
| comparedOctree | the first octree |
| referenceOctree | the second octree |
| maxSearchDist | max search distance (or any negative value if no max distance is defined) |
| progressCb | the client method can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
Definition at line 242 of file DistanceComputationTools.cpp.
References cloudViewer::DgmOctree::build(), cloudViewer::DgmOctree::clear(), DISJOINT, EMPTY_CLOUD, cloudViewer::GenericCloud::getBoundingBox(), cloudViewer::DgmOctree::getNumberOfProjectedPoints(), cloudViewer::DgmOctree::getOctreeMaxs(), cloudViewer::DgmOctree::getOctreeMins(), cloudViewer::CCMiscTools::MakeMinAndMaxCubical(), max(), min(), OUT_OF_MEMORY, cloudViewer::GenericCloud::size(), SYNCHRONIZED, and Tuple3Tpl< Type >::u.
Referenced by computeApproxCloud2CloudDistance(), and computeCloud2CloudDistances().