Point Cloud Library (PCL)
1.10.1
|
42 #include <pcl/registration/correspondence_rejection.h>
43 #include <pcl/point_cloud.h>
47 namespace registration
74 rejection_name_ =
"CorrespondenceRejectorSurfaceNormal";
96 template <
typename Po
intT,
typename NormalT>
inline void
105 template <
typename Po
intT>
inline void
108 PCL_WARN (
"[pcl::registration::%s::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead.\n", getClassName ().c_str ());
109 if (!data_container_)
111 PCL_ERROR (
"[pcl::registration::%s::setInputCloud] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
114 boost::static_pointer_cast<DataContainer<PointT> > (data_container_)->setInputSource (input);
120 template <
typename Po
intT>
inline void
123 if (!data_container_)
125 PCL_ERROR (
"[pcl::registration::%s::setInputCloud] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
128 boost::static_pointer_cast<DataContainer<PointT> > (data_container_)->setInputSource (input);
135 if (!data_container_)
137 PCL_ERROR (
"[pcl::registration::%s::getInputSource] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
146 template <
typename Po
intT>
inline void
149 if (!data_container_)
151 PCL_ERROR (
"[pcl::registration::%s::setInputTarget] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
154 boost::static_pointer_cast<DataContainer<PointT> > (data_container_)->setInputTarget (target);
164 template <
typename Po
intT>
inline void
166 bool force_no_recompute =
false)
168 boost::static_pointer_cast< DataContainer<PointT> >
169 (data_container_)->setSearchMethodTarget (tree, force_no_recompute );
176 if (!data_container_)
178 PCL_ERROR (
"[pcl::registration::%s::getInputTarget] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
187 template <
typename Po
intT,
typename NormalT>
inline void
190 if (!data_container_)
192 PCL_ERROR (
"[pcl::registration::%s::setInputNormals] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
195 boost::static_pointer_cast<DataContainer<PointT, NormalT> > (data_container_)->setInputNormals (normals);
202 if (!data_container_)
204 PCL_ERROR (
"[pcl::registration::%s::getInputNormals] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
213 template <
typename Po
intT,
typename NormalT>
inline void
216 if (!data_container_)
218 PCL_ERROR (
"[pcl::registration::%s::setTargetNormals] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
221 boost::static_pointer_cast<DataContainer<PointT, NormalT> > (data_container_)->setTargetNormals (normals);
228 if (!data_container_)
230 PCL_ERROR (
"[pcl::registration::%s::getTargetNormals] Initialize the data container object by calling intializeDataContainer () before using this function.\n", getClassName ().c_str ());
246 if (!data_container_)
247 initializeDataContainer<PointXYZ, Normal> ();
250 setInputSource<PointXYZ> (cloud);
262 if (!data_container_)
263 initializeDataContainer<PointXYZ, Normal> ();
266 setInputTarget<PointXYZ> (cloud);
278 if (!data_container_)
279 initializeDataContainer<PointXYZ, Normal> ();
282 setInputNormals<PointXYZ, Normal> (cloud);
294 if (!data_container_)
295 initializeDataContainer<PointXYZ, Normal> ();
298 setTargetNormals<PointXYZ, Normal> (cloud);
309 getRemainingCorrespondences (*input_correspondences_, correspondences);
322 #include <pcl/registration/impl/correspondence_rejection_surface_normal.hpp>
shared_ptr< CorrespondenceRejector > Ptr
double threshold_
The median distance threshold between two correspondent points in source <-> target.
This file defines compatibility wrappers for low level I/O functions.
void setTargetNormals(pcl::PCLPointCloud2::ConstPtr cloud2) override
Method for setting the target normals.
bool requiresTargetNormals() const override
See if this rejector requires target normals.
pcl::PointCloud< PointT >::ConstPtr getInputSource() const
Get the target input point cloud.
bool requiresTargetPoints() const override
See if this rejector requires a target cloud.
shared_ptr< const CorrespondenceRejector > ConstPtr
pcl::PointCloud< NormalT >::Ptr getTargetNormals() const
Get the normals computed on the target point cloud.
CorrespondenceRejectorSurfaceNormal()
Empty constructor.
const std::string & getClassName() const
Get a string representation of the name of this class.
void setSourcePoints(pcl::PCLPointCloud2::ConstPtr cloud2) override
Blob method for setting the source cloud.
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.
shared_ptr< KdTree< PointT, Tree > > Ptr
shared_ptr< DataContainerInterface > Ptr
double getThreshold() const
Get the thresholding angle between the normals for correspondence rejection.
bool requiresSourceNormals() const override
See if this rejector requires source normals.
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...
shared_ptr< const ::pcl::PCLPointCloud2 > ConstPtr
DataContainerInterface::Ptr DataContainerPtr
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.
void initializeDataContainer()
Initialize the data container object for the point type and the normal type.
void setSourceNormals(pcl::PCLPointCloud2::ConstPtr cloud2) override
Blob method for setting the source normals.
bool requiresSourcePoints() const override
See if this rejector requires source points.
shared_ptr< PointCloud< PointT > > Ptr
void setTargetNormals(const typename pcl::PointCloud< NormalT >::ConstPtr &normals)
Set the normals computed on the target point cloud.
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.
shared_ptr< const PointCloud< PointT > > ConstPtr
void applyRejection(pcl::Correspondences &correspondences) override
Apply the rejection algorithm.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
void setSearchMethodTarget(const typename pcl::search::KdTree< PointT >::Ptr &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...
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 ...
void setTargetPoints(pcl::PCLPointCloud2::ConstPtr cloud2) override
Method for setting the target cloud.
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.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
pcl::PointCloud< NormalT >::Ptr getInputNormals() const
Get the normals computed on the input point cloud.