Point Cloud Library (PCL)
1.9.1
|
40 #ifndef PCL_REGISTRATION_DEFAULT_CONVERGENCE_CRITERIA_H_
41 #define PCL_REGISTRATION_DEFAULT_CONVERGENCE_CRITERIA_H_
43 #include <pcl/registration/eigen.h>
44 #include <pcl/correspondence.h>
45 #include <pcl/registration/convergence_criteria.h>
49 namespace registration
64 template <
typename Scalar =
float>
68 typedef boost::shared_ptr<DefaultConvergenceCriteria<Scalar> >
Ptr;
69 typedef boost::shared_ptr<const DefaultConvergenceCriteria<Scalar> >
ConstPtr;
71 typedef Eigen::Matrix<Scalar, 4, 4>
Matrix4;
222 for (
size_t i = 0; i < correspondences.size (); ++i)
224 mse /= double (correspondences.size ());
273 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
278 #include <pcl/registration/impl/default_convergence_criteria.hpp>
280 #endif // PCL_REGISTRATION_DEFAULT_CONVERGENCE_CRITERIA_H_
@ CONVERGENCE_CRITERIA_NO_CORRESPONDENCES
virtual ~DefaultConvergenceCriteria()
Empty destructor.
This file defines compatibility wrappers for low level I/O functions.
void setTranslationThreshold(const double threshold)
Set the translation threshold (maximum allowable difference between two consecutive transformations) ...
void setMaximumIterations(const int nr_iterations)
Set the maximum number of iterations the internal optimization should run for.
@ CONVERGENCE_CRITERIA_ABS_MSE
float distance(const PointT &p1, const PointT &p2)
double translation_threshold_
The translation threshold is the relative translation between two iterations (0 if no translation).
double calculateMSE(const pcl::Correspondences &correspondences) const
Calculate the mean squared error (MSE) of the distance for a given set of correspondences.
int max_iterations_
The maximum nuyyGmber of iterations that the registration loop is to be executed.
DefaultConvergenceCriteria represents an instantiation of ConvergenceCriteria, and implements the fol...
int max_iterations_similar_transforms_
The maximum number of iterations that the internal rotation, translation, and MSE differences are all...
void setRelativeMSE(const double mse_relative)
Set the relative MSE between two consecutive sets of correspondences.
bool getFailureAfterMaximumIterations() const
Get whether the registration will fail or converge when the maximum number of iterations is reached.
ConvergenceState convergence_state_
The state of the convergence (e.g., why did the registration converge).
const int & iterations_
The number of iterations done by the registration loop so far.
const pcl::Correspondences & correspondences_
The current set of point correspondences between the source and the target.
void setMaximumIterationsSimilarTransforms(const int nr_iterations)
Set the maximum number of iterations that the internal rotation, translation, and MSE differences are...
@ CONVERGENCE_CRITERIA_NOT_CONVERGED
double getTranslationThreshold() const
Get the rotation threshold cosine angle (maximum allowable difference between two consecutive transfo...
@ CONVERGENCE_CRITERIA_REL_MSE
void setConvergenceState(ConvergenceState c)
Sets the convergence state externally (for example, when ICP does not find enough correspondences to ...
Eigen::Matrix< Scalar, 4, 4 > Matrix4
int getMaximumIterations() const
Get the maximum number of iterations the internal optimization should run for, as set by the user.
ConvergenceState getConvergenceState()
Return the convergence state after hasConverged ()
@ CONVERGENCE_CRITERIA_ITERATIONS
void setAbsoluteMSE(const double mse_absolute)
Set the absolute MSE between two consecutive sets of correspondences.
boost::shared_ptr< DefaultConvergenceCriteria< Scalar > > Ptr
boost::shared_ptr< const DefaultConvergenceCriteria< Scalar > > ConstPtr
void setRotationThreshold(const double threshold)
Set the rotation threshold cosine angle (maximum allowable difference between two consecutive transfo...
virtual bool hasConverged()
Check if convergence has been reached.
double mse_threshold_relative_
The relative change from the previous MSE for the current set of correspondences, e....
bool failure_after_max_iter_
Specifys if the registration fails or converges when the maximum number of iterations is reached.
int getMaximumIterationsSimilarTransforms() const
Get the maximum number of iterations that the internal rotation, translation, and MSE differences are...
double getRotationThreshold() const
Get the rotation threshold cosine angle (maximum allowable difference between two consecutive transfo...
double getAbsoluteMSE() const
Get the absolute MSE between two consecutive sets of correspondences.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
double correspondences_prev_mse_
The MSE for the previous set of correspondences.
@ CONVERGENCE_CRITERIA_TRANSFORM
const Matrix4 & transformation_
The current transformation obtained by the transformation estimation method.
double correspondences_cur_mse_
The MSE for the current set of correspondences.
void setFailureAfterMaximumIterations(const bool failure_after_max_iter)
Specifies if the registration fails or converges when the maximum number of iterations is reached.
int iterations_similar_transforms_
Internal counter for the number of iterations that the internal rotation, translation,...
double getRelativeMSE() const
Get the relative MSE between two consecutive sets of correspondences.
ConvergenceCriteria represents an abstract base class for different convergence criteria used in regi...
double rotation_threshold_
The rotation threshold is the relative rotation between two iterations (as angle cosine).
double mse_threshold_absolute_
The absolute change from the previous MSE for the current set of correspondences.
DefaultConvergenceCriteria(const int &iterations, const Matrix4 &transform, const pcl::Correspondences &correspondences)
Empty constructor.