Public Member Functions | Public Attributes | Protected Attributes

TRTK::RandomSampleIcp3D< ValueType > Class Template Reference

Random Sample ICP algorithm for 3D point clouds. More...

#include <Icp.hpp>

Inheritance diagram for TRTK::RandomSampleIcp3D< ValueType >:
Collaboration diagram for TRTK::RandomSampleIcp3D< ValueType >:

List of all members.

Public Member Functions

ValueType compute ()
 Call this function to perform the transformation estimation. The RMSE is returned.
void setMaximumNumberIterationsFirstStage (unsigned value)
 Sets the maximum number of iterations in the first stage (default is 20).
void setMaximumNumberIterationsSecondStage (unsigned value)
 Sets the maximum number of iterations in the second stage (default is 20).
void setPercentage (unsigned value)
 Sets the portion of randomly selected samples in the first stage. 0 means no samples and 100 means all samples (default is 50).
void setSourcePoints (const std::vector< Coordinate< ValueType > > &source_points)
 Set the data points as decribed here.
void setTargetPoints (const std::vector< Coordinate< ValueType > > &target_points)
 Set the model points as decribed here.
void setInitialEstimation (const Matrix &transformation)
 Set the initial transformation from the source to the target point coordinate system.
void setEstimationAlgorithm (EstimateTransformation3D< ValueType > &estimator)
 Set the transformation estimator.
void setMaximumNumberIterations (unsigned number)
 Set the maximum number of iterations performed by an algorithm (default is 20).
void setMaximumRMSE (ValueType value)
 Set an upper bound of the root mean square error; an algorithm terminates if the error of the current estimation falls below this value (default is 0).
void setEpsApproximate (float value)
 Set the value for the eps-approximate neighbor search. The higher the value the faster the search (but also the less accurate) (default is 0).
void abortComputation ()
 Call this function to abort a running algorithm.
const Matrix & getTransformation ()
 Returns the estimated transformation in the form of a homogeneous matrix.

Public Attributes

Signal< unsigned > progress
 Provides the current state of computation (from 0 to 100).

Protected Attributes

unsigned dimension
 Dimension of the source and target points.
const std::vector< Coordinate
< ValueType > > * 
source_points
 Reference to the data points given by the user. An algorithm might store a local copy which is transformed during the registration procedure.
flann::Matrix< ValueType > target_points
 Internal copy of the model points given by the user.
flann::Matrix< ValueType > query_point
 Query point used to search the kd-tree.
flann::Matrix< ValueType > distances
 Distance to the nearest neighbor obtained by a nearest neighbor search.
flann::Matrix< int > indices
 Index of the nearest neighbor in target_points obtained by a nearest neighbor search.
flann::Index< flann::L2
< ValueType > > * 
tree
 Data structure of the search index (kd-tree).
float eps
 Eps-approximate value for the nearest neighbor search.
EstimateTransformation3D
< ValueType > * 
estimator
 Reference to the user-provided estimator.
unsigned maximum_number_iterations
 Maximum possible number of iterations during the computation.
ValueType maximum_rms_error
 Iteration stop criterion. If the current RMSE falls below this bound, an algorithm might terminate.
Matrix transformation
 Internally stored (homogeneous) transformation.
volatile bool abort
 This flag must be checked during iterations; can be set by other threads through abortComputation().

Detailed Description

template<class ValueType>
class TRTK::RandomSampleIcp3D< ValueType >

Random Sample ICP algorithm for 3D point clouds.

Template Parameters:
ValueTypeScalar type (must be a floating point type).

This algorithm implements a variant of the iterative closest point algorithm.

Basically, it proceeds in two stages. First, the classical iterative closest point algorithm is computed from a subset of data points. This subset is newly created in each iteration by randomly selecting points from the data points set. Since the subset is constantly changing, the convergence is not monotonicly decreasing anymore and the root mean square error might become greater. Hence, after each iteration the current estimate is saved if it is better than a previous estimate (measured by the RMSE). Second, the classical iterative closest point algorithm is run where its intial estimte is set to the best estimate from the first stage.

The maximum number of iterations in the first stage can be set by setMaximumNumberIterationsFirstStage(). The maximum number of iterations in the second stage by setMaximumNumberIterationsSecondStage() or by setMaximumNumberIterations(). The portion of randomly selected samples in the first stage can be set by setPercentage().

For some additional information and an example of how to use this class, please have a look at the interface class.

See also:
IcpInterface and IcpBase
References:

Fieten et al., "Fast and Accurate Registration of Cranial CT Images With A-mode Ultrasound", International Journal of Computer Assisted Radiology and Surgery, 2009

Author:
Christoph Haenisch
Version:
0.1.0
Date:
last changed on 2012-08-16

Definition at line 985 of file Icp.hpp.


Member Function Documentation

template<class ValueType >
ValueType TRTK::RandomSampleIcp3D< ValueType >::compute (  ) [virtual]

Call this function to perform the transformation estimation. The RMSE is returned.

Exceptions:
range_errorA range error exception is thrown if no model points are given.
Note:
The given estimator might throw an exception as well.

Implements TRTK::IcpBase< ValueType >.

Definition at line 1038 of file Icp.hpp.

template<class ValueType >
void TRTK::IcpBase< ValueType >::setSourcePoints ( const std::vector< Coordinate< ValueType > > &  source_points ) [virtual, inherited]

Set the data points as decribed here.

Only a reference is stored.

Implements TRTK::IcpInterface< ValueType >.

Definition at line 404 of file Icp.hpp.

template<class ValueType >
void TRTK::IcpBase< ValueType >::setTargetPoints ( const std::vector< Coordinate< ValueType > > &  target_points ) [virtual, inherited]

Set the model points as decribed here.

The targe points are copied.

Implements TRTK::IcpInterface< ValueType >.

Definition at line 413 of file Icp.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines