43 #include <pcl/features/feature.h>
59 template<
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT = pcl::VFHSignature308>
63 using Ptr = shared_ptr<OURCVFHEstimation<PointInT, PointNT, PointOutT> >;
64 using ConstPtr = shared_ptr<const OURCVFHEstimation<PointInT, PointNT, PointOutT> >;
78 cluster_tolerance_ (leaf_size_ * 3),
79 radius_normals_ (leaf_size_ * 3)
84 refine_clusters_ = 1.f;
85 min_axis_value_ = 0.925f;
97 inline Eigen::Matrix4f
98 createTransFromAxes (Eigen::Vector3f & evx, Eigen::Vector3f & evy, Eigen::Vector3f & evz, Eigen::Affine3f & transformPC,
99 Eigen::Matrix4f & center_mat)
101 Eigen::Matrix4f trans;
102 trans.setIdentity (4, 4);
103 trans (0, 0) = evx (0, 0);
104 trans (1, 0) = evx (1, 0);
105 trans (2, 0) = evx (2, 0);
106 trans (0, 1) = evy (0, 0);
107 trans (1, 1) = evy (1, 0);
108 trans (2, 1) = evy (2, 0);
109 trans (0, 2) = evz (0, 0);
110 trans (1, 2) = evz (1, 0);
111 trans (2, 2) = evz (2, 0);
113 Eigen::Matrix4f homMatrix = Eigen::Matrix4f ();
114 homMatrix.setIdentity (4, 4);
115 homMatrix = transformPC.matrix ();
117 Eigen::Matrix4f trans_copy = trans.inverse ();
118 trans.noalias() = trans_copy * center_mat * homMatrix;
139 sgurf (Eigen::Vector3f & centroid, Eigen::Vector3f & normal_centroid,
PointInTPtr & processed, std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > & transformations,
172 radius_normals_ = radius_normals;
192 getCentroidClusters (std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)
195 centroids.push_back (centroids_dominant_orientation);
205 centroids.push_back (dominant_normal);
215 cluster_tolerance_ = d;
224 eps_angle_threshold_ = d;
251 normalize_bins_ = normalize;
278 refine_clusters_ = rc;
285 getTransforms (std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > & trans)
297 valid = valid_transforms_;
328 float vpx_{0.0f}, vpy_{0.0f}, vpz_{0.0f};
333 float leaf_size_{0.005f};
336 bool normalize_bins_{
false};
339 float curv_threshold_{0.03f};
342 float cluster_tolerance_;
345 float eps_angle_threshold_{0.125f};
350 std::size_t min_points_{50};
353 float radius_normals_;
356 float refine_clusters_;
358 std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > transforms_;
359 std::vector<bool> valid_transforms_;
362 float min_axis_value_;
390 std::vector<pcl::PointIndices> &clusters,
double eps_angle,
unsigned int min_pts_per_cluster = 1,
391 unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ());
405 #ifdef PCL_NO_PRECOMPILE
406 #include <pcl/features/impl/our_cvfh.hpp>
Feature represents the base feature class.
double search_radius_
The nearest neighbors search radius for each point.
int k_
The number of K nearest neighbors to use for each point.
shared_ptr< Feature< PointInT, PointOutT > > Ptr
std::string feature_name_
The feature name.
shared_ptr< const Feature< PointInT, PointOutT > > ConstPtr
typename KdTree::Ptr KdTreePtr
OURCVFHEstimation estimates the Oriented, Unique and Repetable Clustered Viewpoint Feature Histogram ...
void setClusterTolerance(float d)
Sets max.
void setNormalizeBins(bool normalize)
Sets whether the signatures should be normalized or not.
void getValidTransformsVec(std::vector< bool > &valid)
Returns a boolean vector indicating of the transformation obtained by getTransforms() represents a va...
bool sgurf(Eigen::Vector3f ¢roid, Eigen::Vector3f &normal_centroid, PointInTPtr &processed, std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > &transformations, PointInTPtr &grid, pcl::PointIndices &indices)
Computes SGURF.
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
void filterNormalsWithHighCurvature(const pcl::PointCloud< PointNT > &cloud, pcl::Indices &indices_to_use, pcl::Indices &indices_out, pcl::Indices &indices_in, float threshold)
Removes normals with high curvature caused by real edges or noisy data.
void getCentroidClusters(std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > ¢roids)
Get the centroids used to compute different CVFH descriptors.
void getViewPoint(float &vpx, float &vpy, float &vpz)
Get the viewpoint.
void setRadiusNormals(float radius_normals)
Set the radius used to compute normals.
void getTransforms(std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > &trans)
Returns the transformations aligning the point cloud to the corresponding SGURF.
void getCentroidNormalClusters(std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > ¢roids)
Get the normal centroids used to compute different CVFH descriptors.
void setMinAxisValue(float f)
Sets the min disambiguition axis value to generate several SGURFs for the cluster when disambiguition...
void compute(PointCloudOut &output)
Overloaded computed method from pcl::Feature.
Eigen::Matrix4f createTransFromAxes(Eigen::Vector3f &evx, Eigen::Vector3f &evy, Eigen::Vector3f &evz, Eigen::Affine3f &transformPC, Eigen::Matrix4f ¢er_mat)
Creates an affine transformation from the RF axes.
void setViewPoint(float vpx, float vpy, float vpz)
Set the viewpoint.
void setRefineClusters(float rc)
Sets the refinement factor for the clusters.
OURCVFHEstimation()
Empty constructor.
std::vector< pcl::PointIndices > clusters_
Indices to the points representing the stable clusters.
std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > dominant_normals_
Normal centroids that were used to compute different OUR-CVFH descriptors.
std::vector< short > cluster_axes_
Mapping from clusters to OUR-CVFH descriptors.
std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > centroids_dominant_orientations_
Centroids that were used to compute different OUR-CVFH descriptors.
void setAxisRatio(float f)
Sets the min axis ratio between the SGURF axes to decide if disambiguition is feasible.
typename pcl::PointCloud< PointInT >::Ptr PointInTPtr
void setCurvatureThreshold(float d)
Sets curvature threshold for removing normals.
void getClusterIndices(std::vector< pcl::PointIndices > &indices)
Gets the indices of the original point cloud used to compute the signatures.
void getClusterAxes(std::vector< short > &cluster_axes)
Gets the number of non-disambiguable axes that correspond to each centroid.
void setMinPoints(std::size_t min)
Set minimum amount of points for a cluster to be considered.
void setEPSAngleThreshold(float d)
Sets max.
void computeRFAndShapeDistribution(PointInTPtr &processed, PointCloudOut &output, std::vector< pcl::PointIndices > &cluster_indices)
Computes SGURF and the shape distribution based on the selected SGURF.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< pcl::search::Search< PointT > > Ptr
Defines all the PCL implemented PointT point type structures.
IndicesAllocator<> Indices
Type used for indices in PCL.