MeshLib Documentation
Loading...
Searching...
No Matches
MR::ICP Class Reference

#include <MRICP.h>

Public Member Functions

 ICP (const MeshOrPoints &flt, const MeshOrPoints &ref, const AffineXf3f &fltXf, const AffineXf3f &refXf, const VertBitSet &fltSamples={}, const VertBitSet &refSamples={})
 
MRMESH_API ICP (const MeshOrPointsXf &flt, const MeshOrPointsXf &ref, const VertBitSet &fltSamples={}, const VertBitSet &refSamples={})
 
MRMESH_API ICP (const MeshOrPoints &flt, const MeshOrPoints &ref, const AffineXf3f &fltXf, const AffineXf3f &refXf, float samplingVoxelSize)
 
MRMESH_API ICP (const MeshOrPointsXf &flt, const MeshOrPointsXf &ref, float samplingVoxelSize)
 
void setParams (const ICPProperties &prop)
 tune algorithm params before run calculateTransformation()
 
MRMESH_API void setCosineLimit (const float cos)
 
MRMESH_API void setDistanceLimit (const float dist)
 
MRMESH_API void setBadIterCount (const int iter)
 
MRMESH_API void setFarDistFactor (const float factor)
 
MRMESH_API void setFltSamples (const VertBitSet &fltSamples)
 select pairs with origin samples on floating object
 
MRMESH_API void sampleFltPoints (float samplingVoxelSize)
 
MRMESH_API void setRefSamples (const VertBitSet &refSamples)
 select pairs with origin samples on reference object
 
MRMESH_API void sampleRefPoints (float samplingVoxelSize)
 
void samplePoints (float samplingVoxelSize)
 select pairs with origin samples on both objects
 
void recomputeBitSet (float fltSamplingVoxelSize)
 
MRMESH_API void setXfs (const AffineXf3f &fltXf, const AffineXf3f &refXf)
 sets to-world transformations both for floating and reference objects
 
MRMESH_API void setFloatXf (const AffineXf3f &fltXf)
 sets to-world transformation for the floating object
 
MRMESH_API AffineXf3f autoSelectFloatXf ()
 
MRMESH_API void updatePointPairs ()
 recompute point pairs after manual change of transformations or parameters
 
const ICPPropertiesgetParams () const
 
MRMESH_API std::string getStatusInfo () const
 
size_t getNumSamples () const
 computes the number of samples able to form pairs
 
size_t getNumActivePairs () const
 computes the number of active point pairs
 
MRMESH_API float getMeanSqDistToPoint () const
 computes root-mean-square deviation between points
 
MRMESH_API float getMeanSqDistToPlane () const
 computes root-mean-square deviation from points to target planes
 
const PointPairsgetFlt2RefPairs () const
 returns current pairs formed from samples on floating object and projections on reference object
 
const PointPairsgetRef2FltPairs () const
 returns current pairs formed from samples on reference object and projections on floating object
 
MRMESH_API AffineXf3f calculateTransformation ()
 

Detailed Description

This class allows you to register two object with similar shape using Iterative Closest Points (ICP) point-to-point or point-to-plane algorithms

Constructor & Destructor Documentation

◆ ICP() [1/4]

MR::ICP::ICP ( const MeshOrPoints & flt,
const MeshOrPoints & ref,
const AffineXf3f & fltXf,
const AffineXf3f & refXf,
const VertBitSet & fltSamples = {},
const VertBitSet & refSamples = {} )
inline

Constructs ICP framework with given sample points on both objects

Parameters
fltfloating object
refreference object
fltXftransformation from floating object space to global space
refXftransformation from reference object space to global space
fltSamplessamples on floating object to find projections on the reference object during the algorithm
refSamplessamples on reference object to find projections on the floating object during the algorithm

◆ ICP() [2/4]

MRMESH_API MR::ICP::ICP ( const MeshOrPointsXf & flt,
const MeshOrPointsXf & ref,
const VertBitSet & fltSamples = {},
const VertBitSet & refSamples = {} )

◆ ICP() [3/4]

MRMESH_API MR::ICP::ICP ( const MeshOrPoints & flt,
const MeshOrPoints & ref,
const AffineXf3f & fltXf,
const AffineXf3f & refXf,
float samplingVoxelSize )
inline

Constructs ICP framework with automatic points sampling on both objects

Parameters
fltfloating object
refreference object
fltXftransformation from floating object space to global space
refXftransformation from reference object space to global space
samplingVoxelSizeapproximate distance between samples on each of two objects

◆ ICP() [4/4]

MRMESH_API MR::ICP::ICP ( const MeshOrPointsXf & flt,
const MeshOrPointsXf & ref,
float samplingVoxelSize )

Member Function Documentation

◆ autoSelectFloatXf()

MRMESH_API AffineXf3f MR::ICP::autoSelectFloatXf ( )

automatically selects initial transformation for the floating object based on covariance matrices of both floating and reference objects; applies the transformation to the floating object and returns it

◆ calculateTransformation()

MRMESH_API AffineXf3f MR::ICP::calculateTransformation ( )
nodiscard

runs ICP algorithm given input objects, transformations, and parameters;

Returns
adjusted transformation of the floating object to match reference object

◆ getFlt2RefPairs()

const PointPairs & MR::ICP::getFlt2RefPairs ( ) const
inlinenodiscard

returns current pairs formed from samples on floating object and projections on reference object

◆ getMeanSqDistToPlane()

MRMESH_API float MR::ICP::getMeanSqDistToPlane ( ) const
nodiscard

computes root-mean-square deviation from points to target planes

◆ getMeanSqDistToPoint()

MRMESH_API float MR::ICP::getMeanSqDistToPoint ( ) const
nodiscard

computes root-mean-square deviation between points

◆ getNumActivePairs()

size_t MR::ICP::getNumActivePairs ( ) const
inlinenodiscard

computes the number of active point pairs

◆ getNumSamples()

size_t MR::ICP::getNumSamples ( ) const
inlinenodiscard

computes the number of samples able to form pairs

◆ getParams()

const ICPProperties & MR::ICP::getParams ( ) const
inlinenodiscard

◆ getRef2FltPairs()

const PointPairs & MR::ICP::getRef2FltPairs ( ) const
inlinenodiscard

returns current pairs formed from samples on reference object and projections on floating object

◆ getStatusInfo()

MRMESH_API std::string MR::ICP::getStatusInfo ( ) const
nodiscard

◆ recomputeBitSet()

void MR::ICP::recomputeBitSet ( float fltSamplingVoxelSize)
inline

◆ sampleFltPoints()

MRMESH_API void MR::ICP::sampleFltPoints ( float samplingVoxelSize)

◆ samplePoints()

void MR::ICP::samplePoints ( float samplingVoxelSize)
inline

select pairs with origin samples on both objects

◆ sampleRefPoints()

MRMESH_API void MR::ICP::sampleRefPoints ( float samplingVoxelSize)

◆ setBadIterCount()

MRMESH_API void MR::ICP::setBadIterCount ( const int iter)

◆ setCosineLimit()

MRMESH_API void MR::ICP::setCosineLimit ( const float cos)

◆ setDistanceLimit()

MRMESH_API void MR::ICP::setDistanceLimit ( const float dist)

◆ setFarDistFactor()

MRMESH_API void MR::ICP::setFarDistFactor ( const float factor)

◆ setFloatXf()

MRMESH_API void MR::ICP::setFloatXf ( const AffineXf3f & fltXf)

sets to-world transformation for the floating object

◆ setFltSamples()

MRMESH_API void MR::ICP::setFltSamples ( const VertBitSet & fltSamples)

select pairs with origin samples on floating object

◆ setParams()

void MR::ICP::setParams ( const ICPProperties & prop)
inline

tune algorithm params before run calculateTransformation()

◆ setRefSamples()

MRMESH_API void MR::ICP::setRefSamples ( const VertBitSet & refSamples)

select pairs with origin samples on reference object

◆ setXfs()

MRMESH_API void MR::ICP::setXfs ( const AffineXf3f & fltXf,
const AffineXf3f & refXf )

sets to-world transformations both for floating and reference objects

◆ updatePointPairs()

MRMESH_API void MR::ICP::updatePointPairs ( )

recompute point pairs after manual change of transformations or parameters


The documentation for this class was generated from the following file: