Point Cloud Library (PCL)
1.9.1
|
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 ());
115 boost::static_pointer_cast<DataContainer<PointT> > (data_container_)->setInputSource (input);
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 ());
129 boost::static_pointer_cast<DataContainer<PointT> > (data_container_)->setInputSource (input);
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 ());
155 boost::static_pointer_cast<DataContainer<PointT> > (data_container_)->setInputTarget (target);
165 template <
typename Po
intT>
inline void
167 bool force_no_recompute =
false)
169 boost::static_pointer_cast< DataContainer<PointT> >
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 ());
196 boost::static_pointer_cast<DataContainer<PointT, NormalT> > (data_container_)->setInputNormals (normals);
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 ());
222 boost::static_pointer_cast<DataContainer<PointT, NormalT> > (data_container_)->setTargetNormals (normals);
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 setSourceNormals(pcl::PCLPointCloud2::ConstPtr cloud2)
Blob method for setting the source normals.
double threshold_
The median distance threshold between two correspondent points in source <-> target.
This file defines compatibility wrappers for low level I/O functions.
boost::shared_ptr< PointCloud< PointT > > Ptr
pcl::PointCloud< PointT >::ConstPtr getInputSource() const
Get the target input point cloud.
boost::shared_ptr< DataContainerInterface > DataContainerPtr
pcl::PointCloud< NormalT >::Ptr getTargetNormals() const
Get the normals computed on the target point cloud.
CorrespondenceRejectorSurfaceNormal()
Empty constructor.
void applyRejection(pcl::Correspondences &correspondences)
Apply the rejection algorithm.
const std::string & getClassName() const
Get a string representation of the name of this class.
PointCloud represents the base class in PCL for storing collections of 3D points.
void setInputNormals(const typename pcl::PointCloud< NormalT >::ConstPtr &normals)
Set the normals computed on the input point cloud.
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 setInputTarget(const typename pcl::PointCloud< PointT >::ConstPtr &target)
Provide a target point cloud dataset (must contain XYZ data!), used to compute the correspondence dis...
bool requiresTargetPoints() const
See if this rejector requires a target cloud.
DataContainer is a container for the input and target point clouds and implements the interface to co...
DataContainerPtr data_container_
A pointer to the DataContainer object containing the input and target point clouds.
pcl::PointCloud< PointT >::ConstPtr getInputTarget() const
Get the target input point cloud.
bool requiresSourceNormals() const
See if this rejector requires source normals.
void setSourcePoints(pcl::PCLPointCloud2::ConstPtr cloud2)
Blob method for setting the source cloud.
void initializeDataContainer()
Initialize the data container object for the point type and the normal type.
void setTargetPoints(pcl::PCLPointCloud2::ConstPtr cloud2)
Method for setting the target cloud.
boost::shared_ptr< const CorrespondenceRejectorSurfaceNormal > ConstPtr
void setTargetNormals(pcl::PCLPointCloud2::ConstPtr cloud2)
Method for setting the target normals.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
void setTargetNormals(const typename pcl::PointCloud< NormalT >::ConstPtr &normals)
Set the normals computed on the target point cloud.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
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 setThreshold(double threshold)
Set the thresholding angle between the normals for correspondence rejection.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
boost::shared_ptr< CorrespondenceRejectorSurfaceNormal > Ptr
bool requiresTargetNormals() const
See if this rejector requires target normals.
bool requiresSourcePoints() const
See if this rejector requires source points.
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...
CorrespondencesConstPtr input_correspondences_
The input correspondences.
std::string rejection_name_
The name of the rejection method.
CorrespondenceRejectorSurfaceNormal implements a simple correspondence rejection method based on the ...
CorrespondenceRejector represents the base class for correspondence rejection methods
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.
pcl::PointCloud< NormalT >::Ptr getInputNormals() const
Get the normals computed on the input point cloud.