CVB++ 15.0
AlignmentResult2D Class Reference

A set of parameters that stores the result of alignment operation. More...

#include <cvb/foundation/curve.hpp>

Public Member Functions

const Matrix2DRotation () const noexcept
 Gets the estimated rotation. More...
 
const Vector2D< double > & Translation () const noexcept
 Gets the estimated translation. More...
 
double MeanDistance () const noexcept
 Gets the mean distance between reference and aligned curve. More...
 
size_t NumIterations () const noexcept
 Gets the number of iterations needed for alignment. More...
 

Friends

AlignmentResult2D AlignCurve (const std::vector< Point2D< double > > &, const std::vector< Point2D< double > > &, const AlignmentConfiguration &)
 Aligns two 2D curves via an iterative closest point method considering consensus correspondence for better shape alignment. More...
 

Detailed Description

A set of parameters that stores the result of alignment operation.

Member Function Documentation

◆ MeanDistance()

double MeanDistance ( ) const
inlinenoexcept

Gets the mean distance between reference and aligned curve.

Returns
Mean distance between reference and aligned curve.
Exceptions
Doesnot throw any exception.

◆ NumIterations()

size_t NumIterations ( ) const
inlinenoexcept

Gets the number of iterations needed for alignment.

Returns
The number of iterations needed for alignment.
Exceptions
Doesnot throw any exception.

◆ Rotation()

const Matrix2D & Rotation ( ) const
inlinenoexcept

Gets the estimated rotation.

Returns
The estimated rotation.
Exceptions
Doesnot throw any exception.

◆ Translation()

const Vector2D< double > & Translation ( ) const
inlinenoexcept

Gets the estimated translation.

Returns
The estimated translation.
Exceptions
Doesnot throw any exception.

Friends And Related Function Documentation

◆ AlignCurve

AlignmentResult2D AlignCurve ( const std::vector< Point2D< double > > &  curve,
const std::vector< Point2D< double > > &  curveToBeAligned,
const AlignmentConfiguration config = AlignmentConfiguration() 
)
friend

Aligns two 2D curves via an iterative closest point method considering consensus correspondence for better shape alignment.

Parameters
[in]curveReference curve.
[in]curveToBeAlignedCurve to be aligned to curve.
[in]configConfiguration of alignment.
Returns
Alignment result.
Exceptions
Anyexception derived from std::exception including CvbException.

The method used here is a version of the ICP (iterative closest point) method. It uses a consensus metric to find the correspondence between points to stabilize the iterations needed in the alignment method. It supports only rigid transformations for the alignment.

If not enough points within a given consent are found a classical ICP step is performed by finding correspondences solely based on nearest neighbours without any feasibility check.