40 #ifndef PCL_REGISTRATION_TRANSFORMATION_VALIDATION_EUCLIDEAN_H_
41 #define PCL_REGISTRATION_TRANSFORMATION_VALIDATION_EUCLIDEAN_H_
43 #include <pcl/point_representation.h>
44 #include <pcl/search/kdtree.h>
45 #include <pcl/kdtree/kdtree.h>
46 #include <pcl/kdtree/kdtree_flann.h>
47 #include <pcl/registration/transformation_validation.h>
51 namespace registration
73 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
79 typedef boost::shared_ptr<TransformationValidation<PointSource, PointTarget, Scalar> >
Ptr;
80 typedef boost::shared_ptr<const TransformationValidation<PointSource, PointTarget, Scalar> >
ConstPtr;
97 tree_ (new
pcl::search::KdTree<PointTarget>),
133 bool force_no_recompute =
false)
136 if (force_no_recompute)
174 const PointCloudSourceConstPtr &cloud_src,
175 const PointCloudTargetConstPtr &cloud_tgt,
176 const Matrix4 &transformation_matrix)
const;
187 operator() (
const double &score1,
const double &score2)
const
189 return (score1 < score2);
202 const PointCloudSourceConstPtr &cloud_src,
203 const PointCloudTargetConstPtr &cloud_tgt,
204 const Matrix4 &transformation_matrix)
const
208 PCL_ERROR (
"[pcl::TransformationValidationEuclidean::isValid] Threshold not set! Please use setThreshold () before continuing.");
240 typedef boost::shared_ptr<MyPointRepresentation>
Ptr;
241 typedef boost::shared_ptr<const MyPointRepresentation>
ConstPtr;
262 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
267 #include <pcl/registration/impl/transformation_validation_euclidean.hpp>
269 #endif // PCL_REGISTRATION_TRANSFORMATION_VALIDATION_EUCLIDEAN_H_
boost::shared_ptr< KdTree< PointT > > Ptr
PointCloudSource::ConstPtr PointCloudSourceConstPtr
int nr_dimensions_
The number of dimensions in this point's vector (i.e.
TransformationValidationEuclidean()
Constructor.
boost::shared_ptr< const PointRepresentation< PointTarget > > PointRepresentationConstPtr
virtual bool isValid(const PointCloudSourceConstPtr &cloud_src, const PointCloudTargetConstPtr &cloud_tgt, const Matrix4 &transformation_matrix) const
Check if the score is valid for a specific transformation.
bool trivial_
Indicates whether this point representation is trivial.
boost::shared_ptr< const TransformationValidation< PointSource, PointTarget, Scalar > > ConstPtr
Eigen::Matrix< Scalar, 4, 4 > Matrix4
virtual bool operator()(const double &score1, const double &score2) const
Comparator function for deciding which score is better after running the validation on multiple trans...
bool force_no_recompute_
A flag which, if set, means the tree operating on the target cloud will never be recomputed.
Internal point representation uses only 3D coordinates for L2.
TransformationValidation< PointSource, PointTarget >::PointCloudSourceConstPtr PointCloudSourceConstPtr
boost::shared_ptr< MyPointRepresentation > Ptr
pcl::search::KdTree< PointTarget > KdTree
boost::shared_ptr< const MyPointRepresentation > ConstPtr
double getThreshold()
Get the threshold for which a specific transformation is valid.
boost::shared_ptr< TransformationValidation< PointSource, PointTarget, Scalar > > Ptr
TransformationValidation< PointSource, PointTarget >::PointCloudTargetConstPtr PointCloudTargetConstPtr
virtual ~TransformationValidationEuclidean()
double validateTransformation(const PointCloudSourceConstPtr &cloud_src, const PointCloudTargetConstPtr &cloud_tgt, const Matrix4 &transformation_matrix) const
Validate the given transformation with respect to the input cloud data, and return a score...
KdTree::PointRepresentationConstPtr PointRepresentationConstPtr
void setMaxRange(double max_range)
Set the maximum allowable distance between a point and its correspondence in the target in order for ...
void setThreshold(double threshold)
Set a threshold for which a specific transformation is considered valid.
double threshold_
The threshold for which a specific transformation is valid.
TransformationValidation< PointSource, PointTarget, Scalar >::Matrix4 Matrix4
pcl::search::KdTree< PointTarget >::Ptr KdTreePtr
virtual ~MyPointRepresentation()
Empty destructor.
double max_range_
The maximum allowable distance between a point and its correspondence in the target in order for a co...
KdTreePtr tree_
A pointer to the spatial search object.
PointCloudTarget::ConstPtr PointCloudTargetConstPtr
TransformationValidationEuclidean computes an L2SQR norm between a source and target dataset...
void setSearchMethodTarget(const KdTreePtr &tree, bool force_no_recompute=false)
Provide a pointer to the search object used to find correspondences in the target cloud...
virtual void copyToFloatArray(const PointTarget &p, float *out) const
Copy point data from input point to a float array.
PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensi...
double getMaxRange()
Get the maximum allowable distance between a point and its correspondence, as set by the user...