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


Classes | |
| struct | Base |
| FCPS base. More... | |
Static Public Member Functions | |
| static bool | RegisterClouds (GenericIndexedCloud *modelCloud, GenericIndexedCloud *dataCloud, ScaledTransformation &transform, ScalarType delta, ScalarType beta, PointCoordinateType overlap, unsigned nbBases, unsigned nbTries, GenericProgressCallback *progressCb=nullptr, unsigned nbMaxCandidates=0) |
| Registers two point clouds. More... | |
Static Public Member Functions inherited from cloudViewer::RegistrationTools | |
| static void | FilterTransformation (const ScaledTransformation &inTrans, int transformationFilters, const CCVector3 &toBeAlignedGravityCenter, const CCVector3 &referenceGravityCenter, ScaledTransformation &outTrans) |
Static Protected Member Functions | |
| static bool | FindBase (GenericIndexedCloud *cloud, PointCoordinateType overlap, unsigned nbTries, Base &base) |
| Randomly finds a 4 points base in a cloud. More... | |
| static int | FindCongruentBases (KDTree *tree, ScalarType delta, const CCVector3 *base[4], std::vector< Base > &results) |
| static unsigned | ComputeRegistrationScore (KDTree *modelTree, GenericIndexedCloud *dataCloud, ScalarType delta, const ScaledTransformation &dataToModel) |
| Registration score computation function. More... | |
| static bool | LinesIntersections (const CCVector3 &p0, const CCVector3 &p1, const CCVector3 &p2, const CCVector3 &p3, CCVector3 &inter, PointCoordinateType &lambda, PointCoordinateType &mu) |
| Find the 3D pseudo intersection between two lines. More... | |
| static bool | FilterCandidates (GenericIndexedCloud *modelCloud, GenericIndexedCloud *dataCloud, Base &reference, std::vector< Base > &candidates, unsigned nbMaxCandidates, std::vector< ScaledTransformation > &transforms) |
Static Protected Member Functions inherited from cloudViewer::RegistrationTools | |
| static bool | RegistrationProcedure (GenericCloud *P, GenericCloud *X, ScaledTransformation &trans, bool adjustScale=false, ScalarField *coupleWeights=nullptr, PointCoordinateType aPrioriScale=1.0f, CCVector3 *Gp=nullptr, CCVector3 *Gx=nullptr) |
| ICP Registration procedure with optional scale estimation. More... | |
Additional Inherited Members | |
Public Types inherited from cloudViewer::RegistrationTools | |
| enum | TRANSFORMATION_FILTERS { SKIP_NONE = 0 , SKIP_RXY = 1 , SKIP_RYZ = 2 , SKIP_RXZ = 4 , SKIP_ROTATION = 7 , SKIP_TX = 8 , SKIP_TY = 16 , SKIP_TZ = 32 , SKIP_TRANSLATION = 56 } |
| Transformation constraints. More... | |
| using | ScaledTransformation = PointProjectionTools::Transformation |
| Shortcut to PointProjectionTools::ScaledTransformation. More... | |
Four Points Congruent Sets (4PCS) registration algorithm (Dror Aiger, Niloy J. Mitra, Daniel Cohen-Or)
Definition at line 246 of file RegistrationTools.h.
|
staticprotected |
Registration score computation function.
!
| modelTree | KD-tree containing the model point cloud |
| dataCloud | data point cloud |
| dataToModel | transformation that, applied to data points, register model and data clouds |
| delta | tolerance above which data points are not counted (if a point is less than delta-apart from the model cloud, then it is counted) |
Definition at line 1284 of file RegistrationTools.cpp.
References count, cloudViewer::KDTree::findPointBelowDistance(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::PointProjectionTools::Transformation::R, cloudViewer::GenericCloud::size(), cloudViewer::PointProjectionTools::Transformation::T, and Tuple3Tpl< Type >::u.
Referenced by RegisterClouds().
|
staticprotected |
!function to keep only the N best candidates bases (by comparison with the reference base invariants) Let B1 and B2 be 2 candidates, R be the reference, B1 and B2 aligned with R. B1 is better than B2 if the distance between B1 and R points is smaller than distance between B2 and R points. This function also computes and store the rigid transforms that align candidates with reference base
| modelCloud | the model point cloud to work on |
| dataCloud | the data point cloud to work on |
| reference | reference base |
| candidates | array of candidates bases. At the end of the function, this array contains the nbMaxBases best candidates only |
| nbMaxCandidates | maximal number of candidates allowed (if 0, number of candidates is not bounded) |
| transforms | array of rigid transforms that align candidates bases with the reference base |
Definition at line 1633 of file RegistrationTools.cpp.
References cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::PointProjectionTools::applyTransformation(), copy, cloudViewer::FPCSRegistrationTools::Base::getIndex(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::RegistrationTools::RegistrationProcedure(), cloudViewer::PointCloudTpl< T >::reserve(), cloudViewer::PointCloudTpl< T >::reset(), and cloudViewer::PointCloud::resize().
Referenced by RegisterClouds().
|
staticprotected |
Randomly finds a 4 points base in a cloud.
| cloud | the point cloud in which we want to find a base |
| overlap | estimation of the overlap rate |
| nbTries | the maximum number of tries to find a base |
| base | the resulting base |
Definition at line 1306 of file RegistrationTools.cpp.
References abs(), Vector3Tpl< Type >::dot(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::FPCSRegistrationTools::Base::init(), Vector3Tpl< Type >::norm2(), normal, cloudViewer::GenericCloud::size(), size, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by RegisterClouds().
|
staticprotected |
Find bases which are congruent to a specified 4 points base
| tree | the KD-tree build from data cloud |
| delta | used for the tolerance when searching for congruent bases |
| base | the reference base made of 4 points |
| results | the resulting bases |
Definition at line 1430 of file RegistrationTools.cpp.
References cloudViewer::FPCSRegistrationTools::Base::a, cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::FPCSRegistrationTools::Base::b, cloudViewer::KDTree::buildFromCloud(), cloudViewer::FPCSRegistrationTools::Base::c, count, cloudViewer::FPCSRegistrationTools::Base::d, cloudViewer::KDTree::findNearestNeighbour(), cloudViewer::KDTree::findPointsLyingToDistance(), cloudViewer::KDTree::getAssociatedCloud(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::PointCloudTpl< T >::getPoint(), LinesIntersections(), cloudViewer::PointCloudTpl< T >::reserve(), cloudViewer::GenericCloud::size(), cloudViewer::PointCloudTpl< T >::size(), and Tuple3Tpl< Type >::u.
Referenced by RegisterClouds().
|
staticprotected |
Find the 3D pseudo intersection between two lines.
This function finds the 3D point which is the nearest from the both lines (when this point is unique, i.e. when the lines are not parallel)
| p0 | first of the two distinct points defining the first line (lying on the line) |
| p1 | second of the two distinct points defining the first line (lying on the line) |
| p2 | first of the two distinct points defining the second line |
| p3 | first of the two distinct points defining the second line |
| inter | [out] is the computed intersection (function output) |
| lambda | [out] coeff such that p0+lambda(p1-p0) is the point of [p0, p1] which is the nearest from [p2, p3] |
| mu | [out] coeff such that p2+mu(p3-p2) is the point of [p2, p3] which is the nearest from [p0, p1] |
Definition at line 1595 of file RegistrationTools.cpp.
References abs(), Vector3Tpl< Type >::dot(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by FindCongruentBases().
|
static |
Registers two point clouds.
Implements the 4 Points Congruent Sets Algorithm (Dror Aiger, Niloy J. Mitra, Daniel Cohen-Or
| modelCloud | the reference cloud (won't move) |
| dataCloud | the cloud to register (will move) |
| transform | the resulting transformation (output) |
| delta | maximal distance to the reference cloud for the data points to be considered as registered |
| beta | is used for bases selection (error tolerance) |
| overlap | estimation of the two clouds overlap rate |
| nbBases | number of iteration for the algorithm |
| nbTries | number of tries to find a base in the reference cloud |
| progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
| nbMaxCandidates | if>0, maximal number of candidate bases allowed for each step. Otherwise the number of candidates is not bounded |
Definition at line 1139 of file RegistrationTools.cpp.
References cloudViewer::KDTree::buildFromCloud(), ComputeRegistrationScore(), count, FilterCandidates(), FindBase(), FindCongruentBases(), cloudViewer::GenericCloud::getBoundingBox(), cloudViewer::FPCSRegistrationTools::Base::getIndex(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::SquareMatrixTpl< Scalar >::invalidate(), cloudViewer::GenericProgressCallback::isCancelRequested(), cloudViewer::SquareMatrixTpl< Scalar >::isValid(), Vector3Tpl< Type >::norm(), cloudViewer::PointProjectionTools::Transformation::R, result, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericCloud::size(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::PointProjectionTools::Transformation::T, cloudViewer::GenericProgressCallback::textCanBeEdited(), and cloudViewer::GenericProgressCallback::update().
Referenced by define_RegistrationTools().