Four Points Congruent Sets (4PCS) registration algorithm (Dror Aiger, Niloy J. Mitra, Daniel Cohen-Or)
More...
#include <RegistrationTools.h>
|
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 void | FilterTransformation (const ScaledTransformation &inTrans, int transformationFilters, ScaledTransformation &outTrans) |
| 'Filters' a transformation by constraining it along certain rotation axes and translation directions More...
|
|
|
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 bool | RegistrationProcedure (GenericCloud *P, GenericCloud *X, ScaledTransformation &trans, bool adjustScale=false, ScalarField *coupleWeights=nullptr, PointCoordinateType aPrioriScale=1.0f) |
| ICP Registration procedure with optional scale estimation. More...
|
|
|
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.
|
|
using | ScaledTransformation = PointProjectionTools::Transformation |
| Shortcut to PointProjectionTools::ScaledTransformation.
|
|
Four Points Congruent Sets (4PCS) registration algorithm (Dror Aiger, Niloy J. Mitra, Daniel Cohen-Or)
◆ ComputeRegistrationScore()
Registration score computation function.
!
- Parameters
-
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) |
- Returns
- the number of data points which are distance-apart from the model cloud
◆ FilterCandidates()
!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
- Parameters
-
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 |
- Returns
- false if something went wrong
◆ FindBase()
bool FPCSRegistrationTools::FindBase |
( |
GenericIndexedCloud * |
cloud, |
|
|
PointCoordinateType |
overlap, |
|
|
unsigned |
nbTries, |
|
|
Base & |
base |
|
) |
| |
|
staticprotected |
Randomly finds a 4 points base in a cloud.
- Parameters
-
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 |
- Returns
- false: failure ; true: success
◆ FindCongruentBases()
int FPCSRegistrationTools::FindCongruentBases |
( |
KDTree * |
tree, |
|
|
ScalarType |
delta, |
|
|
const CCVector3 * |
base[4], |
|
|
std::vector< Base > & |
results |
|
) |
| |
|
staticprotected |
Find bases which are congruent to a specified 4 points base
- Parameters
-
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 |
- Returns
- the number of bases found (number of element in the results array) or -1 is a problem occurred
◆ LinesIntersections()
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)
- Parameters
-
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] |
- Returns
- false: no intersection was found (lines may be parallel); true: inter is the pseudo intersection
◆ RegisterClouds()
Registers two point clouds.
Implements the 4 Points Congruent Sets Algorithm (Dror Aiger, Niloy J. Mitra, Daniel Cohen-Or
- Parameters
-
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 |
- Returns
- false: failure ; true: success.
The documentation for this class was generated from the following files:
- RegistrationTools.h
- RegistrationTools.cpp