39 #ifndef PCL_REGISTRATION_CORRESPONDENCE_REJECTION_SURFACE_NORMAL_H_ 40 #define PCL_REGISTRATION_CORRESPONDENCE_REJECTION_SURFACE_NORMAL_H_ 42 #include <pcl/registration/correspondence_rejection.h> 43 #include <pcl/point_cloud.h> 47 namespace registration
67 typedef boost::shared_ptr<CorrespondenceRejectorSurfaceNormal>
Ptr;
68 typedef boost::shared_ptr<const CorrespondenceRejectorSurfaceNormal>
ConstPtr;
75 rejection_name_ =
"CorrespondenceRejectorSurfaceNormal";
97 template <
typename Po
intT,
typename NormalT>
inline void 106 template <
typename Po
intT>
inline void 109 PCL_WARN (
"[pcl::registration::%s::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead.\n", getClassName ().c_str ());
110 if (!data_container_)
112 PCL_ERROR (
"[pcl::registration::%s::setInputCloud] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
121 template <
typename Po
intT>
inline void 124 if (!data_container_)
126 PCL_ERROR (
"[pcl::registration::%s::setInputCloud] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
136 if (!data_container_)
138 PCL_ERROR (
"[pcl::registration::%s::getInputSource] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
147 template <
typename Po
intT>
inline void 150 if (!data_container_)
152 PCL_ERROR (
"[pcl::registration::%s::setInputTarget] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
165 template <
typename Po
intT>
inline void 167 bool force_no_recompute =
false)
170 (data_container_)->setSearchMethodTarget (tree, force_no_recompute );
177 if (!data_container_)
179 PCL_ERROR (
"[pcl::registration::%s::getInputTarget] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
188 template <
typename Po
intT,
typename NormalT>
inline void 191 if (!data_container_)
193 PCL_ERROR (
"[pcl::registration::%s::setInputNormals] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
203 if (!data_container_)
205 PCL_ERROR (
"[pcl::registration::%s::getInputNormals] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
214 template <
typename Po
intT,
typename NormalT>
inline void 217 if (!data_container_)
219 PCL_ERROR (
"[pcl::registration::%s::setTargetNormals] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
229 if (!data_container_)
231 PCL_ERROR (
"[pcl::registration::%s::getTargetNormals] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
247 if (!data_container_)
248 initializeDataContainer<PointXYZ, Normal> ();
251 setInputSource<PointXYZ> (cloud);
263 if (!data_container_)
264 initializeDataContainer<PointXYZ, Normal> ();
267 setInputTarget<PointXYZ> (cloud);
279 if (!data_container_)
280 initializeDataContainer<PointXYZ, Normal> ();
283 setInputNormals<PointXYZ, Normal> (cloud);
295 if (!data_container_)
296 initializeDataContainer<PointXYZ, Normal> ();
299 setTargetNormals<PointXYZ, Normal> (cloud);
310 getRemainingCorrespondences (*input_correspondences_, correspondences);
323 #include <pcl/registration/impl/correspondence_rejection_surface_normal.hpp> void setTargetPoints(pcl::PCLPointCloud2::ConstPtr cloud2)
Method for setting the target cloud.
void fromPCLPointCloud2(const pcl::PCLPointCloud2 &msg, pcl::PointCloud< PointT > &cloud, const MsgFieldMap &field_map)
Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud<T> object using a field_map.
CorrespondenceRejectorSurfaceNormal implements a simple correspondence rejection method based on the ...
DataContainer is a container for the input and target point clouds and implements the interface to co...
void setInputTarget(const typename pcl::PointCloud< PointT >::ConstPtr &target)
Provide a target point cloud dataset (must contain XYZ data!), used to compute the correspondence dis...
void setSourceNormals(pcl::PCLPointCloud2::ConstPtr cloud2)
Blob method for setting the source normals.
pcl::PointCloud< NormalT >::Ptr getTargetNormals() const
Get the normals computed on the target point cloud.
boost::shared_ptr< CorrespondenceRejectorSurfaceNormal > Ptr
double getThreshold() const
Get the thresholding angle between the normals for correspondence rejection.
void setSearchMethodTarget(const boost::shared_ptr< pcl::search::KdTree< PointT > > &tree, bool force_no_recompute=false)
Provide a pointer to the search object used to find correspondences in the target cloud.
void setInputCloud(const typename pcl::PointCloud< PointT >::ConstPtr &input)
Provide a source point cloud dataset (must contain XYZ data!), used to compute the correspondence dis...
CorrespondenceRejector represents the base class for correspondence rejection methods
bool requiresTargetPoints() const
See if this rejector requires a target cloud.
pcl::PointCloud< PointT >::ConstPtr getInputTarget() const
Get the target input point cloud.
boost::shared_ptr< DataContainerInterface > DataContainerPtr
void setSourcePoints(pcl::PCLPointCloud2::ConstPtr cloud2)
Blob method for setting the source cloud.
void setThreshold(double threshold)
Set the thresholding angle between the normals for correspondence rejection.
const std::string & getClassName() const
Get a string representation of the name of this class.
void setTargetNormals(const typename pcl::PointCloud< NormalT >::ConstPtr &normals)
Set the normals computed on the target point cloud.
boost::shared_ptr< PointCloud< PointT > > Ptr
bool requiresSourcePoints() const
See if this rejector requires source points.
void setInputNormals(const typename pcl::PointCloud< NormalT >::ConstPtr &normals)
Set the normals computed on the input point cloud.
bool requiresTargetNormals() const
See if this rejector requires target normals.
boost::shared_ptr< const CorrespondenceRejectorSurfaceNormal > ConstPtr
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
pcl::PointCloud< PointT >::ConstPtr getInputSource() const
Get the target input point cloud.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
double threshold_
The median distance threshold between two correspondent points in source <-> target.
void setTargetNormals(pcl::PCLPointCloud2::ConstPtr cloud2)
Method for setting the target normals.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
pcl::PointCloud< NormalT >::Ptr getInputNormals() const
Get the normals computed on the input point cloud.
PointCloud represents the base class in PCL for storing collections of 3D points.
DataContainerPtr data_container_
A pointer to the DataContainer object containing the input and target point clouds.
bool requiresSourceNormals() const
See if this rejector requires source normals.
CorrespondenceRejectorSurfaceNormal()
Empty constructor.
CorrespondencesConstPtr input_correspondences_
The input correspondences.
std::string rejection_name_
The name of the rejection method.
void setInputSource(const typename pcl::PointCloud< PointT >::ConstPtr &input)
Provide a source point cloud dataset (must contain XYZ data!), used to compute the correspondence dis...
void initializeDataContainer()
Initialize the data container object for the point type and the normal type.
void applyRejection(pcl::Correspondences &correspondences)
Apply the rejection algorithm.