Point Cloud Library (PCL)
1.10.1
|
39 #ifndef PCL_FEATURES_IMPL_GRSD_H_
40 #define PCL_FEATURES_IMPL_GRSD_H_
42 #include <pcl/features/grsd.h>
44 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
int
46 double min_radius_plane,
47 double max_radius_noise,
48 double min_radius_cylinder,
49 double max_min_radius_diff)
51 if (min_radius > min_radius_plane)
53 if (max_radius > min_radius_cylinder)
55 if (min_radius < max_radius_noise)
57 if (max_radius - min_radius < max_min_radius_diff)
63 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void
69 PCL_ERROR (
"[pcl::%s::computeFeature] A voxel cell width needs to be set!\n", getClassName ().c_str ());
81 grid.
filter (*cloud_downsampled);
89 rsd.
setRadiusSearch (std::max (search_radius_, std::sqrt (3.0) * width_ / 2));
94 std::vector<int> types (radii->
points.size ());
95 std::transform(radii->
points.cbegin (), radii->
points.cend (), types.begin (),
96 [](
const auto& point) {
101 Eigen::MatrixXi transition_matrix = Eigen::MatrixXi::Zero (NR_CLASS + 1, NR_CLASS + 1);
102 for (std::size_t idx = 0; idx < cloud_downsampled->points.size (); ++idx)
104 const int source_type = types[idx];
106 for (
const int &neighbor : neighbors)
108 int neighbor_type = NR_CLASS;
110 neighbor_type = types[neighbor];
111 transition_matrix (source_type, neighbor_type)++;
119 for (
int i = 0; i < NR_CLASS + 1; i++)
120 for (
int j = i; j < NR_CLASS + 1; j++)
121 output.
points[0].histogram[nrf++] = transition_matrix (i, j) + transition_matrix (j, i);
124 #define PCL_INSTANTIATE_GRSDEstimation(T,NT,OutT) template class PCL_EXPORTS pcl::GRSDEstimation<T,NT,OutT>;
VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data.
std::uint32_t height
The point cloud height (if organized as an image-structure).
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
void setLeafSize(const Eigen::Vector4f &leaf_size)
Set the voxel grid leaf size.
void filter(PointCloud &output)
Calls the filtering method and returns the filtered dataset in output.
typename PointCloudIn::Ptr PointCloudInPtr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
std::uint32_t width
The point cloud width (if organized as an image-structure).
RSDEstimation estimates the Radius-based Surface Descriptor (minimal and maximal radius of the local ...
void compute(PointCloudOut &output)
Base method for feature estimation for all points given in <setInputCloud (), setIndices ()> using th...
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input dataset that contains the point normals of the XYZ dataset.
std::vector< int > getNeighborCentroidIndices(const PointT &reference_point, const Eigen::MatrixXi &relative_coordinates) const
Returns the indices in the resulting downsampled cloud of the points at the specified grid coordinate...
shared_ptr< PointCloud< PointT > > Ptr
void setSearchSurface(const PointCloudInConstPtr &cloud)
Provide a pointer to a dataset to add additional information to estimate the features for every point...
static int getSimpleType(float min_radius, float max_radius, double min_radius_plane=0.100, double max_radius_noise=0.015, double min_radius_cylinder=0.175, double max_min_radius_diff=0.050)
Get the type of the local surface based on the min and max radius computed.
void computeFeature(PointCloudOut &output) override
Estimate the Global Radius-based Surface Descriptor (GRSD) for a set of points given by <setInputClou...
void setRadiusSearch(double radius)
Set the sphere radius that is to be used for determining the nearest neighbors used for the feature e...
GRSDEstimation estimates the Global Radius-based Surface Descriptor (GRSD) for a given point cloud da...
void setSaveLeafLayout(bool save_leaf_layout)
Set to true if leaf layout information needs to be saved for later access.