43 #include <pcl/registration/correspondence_rejection.h>
44 #include <pcl/conversions.h>
46 #include <pcl/point_cloud.h>
49 namespace registration {
67 using Ptr = shared_ptr<CorrespondenceRejectorMedianDistance>;
68 using ConstPtr = shared_ptr<const CorrespondenceRejectorMedianDistance>;
73 rejection_name_ =
"CorrespondenceRejectorMedianDistance";
90 return (median_distance_);
97 template <
typename Po
intT>
101 if (!data_container_)
103 static_pointer_cast<DataContainer<PointT>>(data_container_)->setInputSource(cloud);
110 template <
typename Po
intT>
114 if (!data_container_)
116 static_pointer_cast<DataContainer<PointT>>(data_container_)->setInputTarget(target);
132 setInputSource<PointXYZ>(cloud);
148 setInputTarget<PointXYZ>(cloud);
158 template <
typename Po
intT>
161 bool force_no_recompute =
false)
163 static_pointer_cast<DataContainer<PointT>>(data_container_)
164 ->setSearchMethodTarget(tree, force_no_recompute);
190 getRemainingCorrespondences(*input_correspondences_, correspondences);
196 double median_distance_{0.0};
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
CorrespondenceRejector represents the base class for correspondence rejection methods
shared_ptr< const CorrespondenceRejector > ConstPtr
CorrespondencesConstPtr input_correspondences_
The input correspondences.
const std::string & getClassName() const
Get a string representation of the name of this class.
shared_ptr< CorrespondenceRejector > Ptr
std::string rejection_name_
The name of the rejection method.
DataContainer is a container for the input and target point clouds and implements the interface to co...
shared_ptr< DataContainerInterface > Ptr
shared_ptr< KdTree< PointT, Tree > > Ptr
Defines functions, macros and traits for allocating and using memory.
void fromPCLPointCloud2(const pcl::PCLPointCloud2 &msg, pcl::PointCloud< PointT > &cloud, const MsgFieldMap &field_map, const std::uint8_t *msg_data)
Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud<T> object using a field_map.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
shared_ptr< const ::pcl::PCLPointCloud2 > ConstPtr