43 #include <pcl/features/feature.h>
58 template<
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT = pcl::VFHSignature308>
62 using Ptr = shared_ptr<OURCVFHEstimation<PointInT, PointNT, PointOutT> >;
63 using ConstPtr = shared_ptr<const OURCVFHEstimation<PointInT, PointNT, PointOutT> >;
77 cluster_tolerance_ (leaf_size_ * 3),
78 radius_normals_ (leaf_size_ * 3)
83 refine_clusters_ = 1.f;
84 min_axis_value_ = 0.925f;
96 inline Eigen::Matrix4f
97 createTransFromAxes (Eigen::Vector3f & evx, Eigen::Vector3f & evy, Eigen::Vector3f & evz, Eigen::Affine3f & transformPC,
98 Eigen::Matrix4f & center_mat)
100 Eigen::Matrix4f trans;
101 trans.setIdentity (4, 4);
102 trans (0, 0) = evx (0, 0);
103 trans (1, 0) = evx (1, 0);
104 trans (2, 0) = evx (2, 0);
105 trans (0, 1) = evy (0, 0);
106 trans (1, 1) = evy (1, 0);
107 trans (2, 1) = evy (2, 0);
108 trans (0, 2) = evz (0, 0);
109 trans (1, 2) = evz (1, 0);
110 trans (2, 2) = evz (2, 0);
112 Eigen::Matrix4f homMatrix = Eigen::Matrix4f ();
113 homMatrix.setIdentity (4, 4);
114 homMatrix = transformPC.matrix ();
116 Eigen::Matrix4f trans_copy = trans.inverse ();
117 trans = trans_copy * center_mat * homMatrix;
138 sgurf (Eigen::Vector3f & centroid, Eigen::Vector3f & normal_centroid,
PointInTPtr & processed, std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > & transformations,
171 radius_normals_ = radius_normals;
191 getCentroidClusters (std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)
194 centroids.push_back (centroids_dominant_orientation);
204 centroids.push_back (dominant_normal);
214 cluster_tolerance_ = d;
223 eps_angle_threshold_ = d;
250 normalize_bins_ = normalize;
277 refine_clusters_ = rc;
284 getTransforms (std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > & trans)
296 valid = valid_transforms_;
327 float vpx_{0.0f}, vpy_{0.0f}, vpz_{0.0f};
332 float leaf_size_{0.005f};
335 bool normalize_bins_{
false};
338 float curv_threshold_{0.03f};
341 float cluster_tolerance_;
344 float eps_angle_threshold_{0.125f};
349 std::size_t min_points_{50};
352 float radius_normals_;
355 float refine_clusters_;
357 std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > transforms_;
358 std::vector<bool> valid_transforms_;
361 float min_axis_value_;
389 std::vector<pcl::PointIndices> &clusters,
double eps_angle,
unsigned int min_pts_per_cluster = 1,
390 unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ());
404 #ifdef PCL_NO_PRECOMPILE
405 #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
IndicesAllocator<> Indices
Type used for indices in PCL.