ImFusion SDK 4.3
ICP Class Reference

#include <ImFusion/Vision/ICP.h>

ICP-based point cloud alignment. More...

Detailed Description

ICP-based point cloud alignment.

Public Types

enum class  MatchingStrategy { NearestNeighbor , Projective }
 Matching strategy for point association. More...
 

Public Member Functions

 ICP (bool useGPU=true)
 Default constructor. If useGPU is true, OpenCL will be used for alignment, otherwise the CPU will be used. GPU support is only available for projective matching.
 
bool loadPointClouds (const std::vector< PointCloud * > &pointClouds)
 Load point clouds to GPU and make them available for later use without prior upload.
 
bool addPointClouds (const std::vector< PointCloud * > &pointClouds)
 Add more point clouds in addition to existing ones.
 
bool setPointClouds (int input, int target)
 Set point cloud from set of previously loaded point clouds - align 1 to 1 case.
 
bool setPointClouds (int input, const std::vector< int > &target)
 Set point clouds from set of previously loaded point clouds - align 1 to n case.
 
bool setPointClouds (PointCloud *input, PointCloud *target)
 Set point clouds.
 
bool setPointClouds (PointCloud *input, const std::vector< PointCloud * > &targets)
 Set point clouds Deletes all preloaded point clouds.
 
PointCloudinputPointCloud () const
 
std::vector< PointCloud * > targetPointClouds () const
 
void setMatchingStrategy (MatchingStrategy s)
 Set matching strategy.
 
MatchingStrategy matchingStrategy () const
 Get matching strategy.
 
void setMinMatches (int minMatches)
 Set minimum number of required matches.
 
int minMatches () const
 Get minimum number of required matches.
 
void setDistanceThreshold (double t)
 Set distance threshold for point matching.
 
double distanceThreshold () const
 Get distance threshold for point matching.
 
void setAngleThreshold (double t)
 Set angle threshold in degrees for normals for point matching.
 
double angleThreshold () const
 Get angle threshold in degrees for normals for point matching.
 
void setOverlapRatio (double o)
 Set (known) overlap ratio between point clouds. Currently not used.
 
double overlapRatio () const
 Get (known) overlap ratio between point clouds. Currently not used.
 
void setAbortIterations (int iter)
 Abort after a certain number of cost function evaluations.
 
int abortIterations () const
 Get the number of iterations after which to abort.
 
void setAbortTime (double sec)
 Abort after a certain elapsed number of seconds.
 
double abortTime () const
 Get the number of seconds after which to abort.
 
void setAbortParTol (double val)
 Abort if change in parameter values becomes too small.
 
double abortParTol () const
 Get the threshold for aborting if change in parameter values becomes too small.
 
double rmsError (int *matchedPoints=nullptr, std::vector< std::vector< int > > *matches=nullptr, bool weighted=true) const
 Compute alignment RMS error using the current point cloud pose.
 
bool align (mat4 *inputT=nullptr, std::pair< double, int > *rms=nullptr)
 Align point clouds.
 

Member Enumeration Documentation

◆ MatchingStrategy

enum class MatchingStrategy
strong

Matching strategy for point association.

Enumerator
NearestNeighbor 

Use nearest neighbor to point. Works for all kinds of point clouds.

Projective 

Project point to other view and take point at that position. This mode requires a dense point cloud and the camera intrinsics for the target point cloud.

Member Function Documentation

◆ loadPointClouds()

bool loadPointClouds ( const std::vector< PointCloud * > & pointClouds)

Load point clouds to GPU and make them available for later use without prior upload.

Ownership is not transferred. To use preloaded point clouds you must use the align method with the input indices as parameters. Calling setPointClouds deletes all preloaded point clouds.

Parameters
pointCloudsPoint clouds to preload

◆ setPointClouds() [1/4]

bool setPointClouds ( int input,
int target )

Set point cloud from set of previously loaded point clouds - align 1 to 1 case.

Parameters
inputInput point cloud index. Must have normals.
targetPoint cloud index to which to align input point cloud. Normals are optional.

◆ setPointClouds() [2/4]

bool setPointClouds ( int input,
const std::vector< int > & target )

Set point clouds from set of previously loaded point clouds - align 1 to n case.

Parameters
inputInput point cloud index. Must have normals.
targetPoint cloud indeces to which to align input point cloud. Normals are optional.

◆ setPointClouds() [3/4]

bool setPointClouds ( PointCloud * input,
PointCloud * target )

Set point clouds.

Deletes all preloaded point clouds.

Parameters
inputInput point cloud. Must have normals.
targetPoint cloud to which to align input point cloud. Normals are optional.

◆ setPointClouds() [4/4]

bool setPointClouds ( PointCloud * input,
const std::vector< PointCloud * > & targets )

Set point clouds Deletes all preloaded point clouds.

Parameters
inputInput point cloud. Must have normals.
targetPoint clouds to which to align input point cloud. Normals are optional.

◆ align()

bool align ( mat4 * inputT = nullptr,
std::pair< double, int > * rms = nullptr )

Align point clouds.

If the alignment succeeds the matrix of the input point cloud will be updated. If inputT has been specified the point cloud matrix will not be updated and the new matrix will be returned in inputT.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close