41 #ifndef PCL_FEATURES_OURCVFH_H_
42 #define PCL_FEATURES_OURCVFH_H_
44 #include <pcl/features/feature.h>
45 #include <pcl/search/pcl_search.h>
46 #include <pcl/common/common.h>
61 template<
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT = pcl::VFHSignature308>
65 typedef boost::shared_ptr<OURCVFHEstimation<PointInT, PointNT, PointOutT> >
Ptr;
66 typedef boost::shared_ptr<const OURCVFHEstimation<PointInT, PointNT, PointOutT> >
ConstPtr;
80 vpx_ (0), vpy_ (0), vpz_ (0), leaf_size_ (0.005f), normalize_bins_ (false), curv_threshold_ (0.03f), cluster_tolerance_ (leaf_size_ * 3),
87 refine_clusters_ = 1.f;
88 min_axis_value_ = 0.925f;
100 inline Eigen::Matrix4f
101 createTransFromAxes (Eigen::Vector3f & evx, Eigen::Vector3f & evy, Eigen::Vector3f & evz, Eigen::Affine3f & transformPC,
102 Eigen::Matrix4f & center_mat)
104 Eigen::Matrix4f trans;
105 trans.setIdentity (4, 4);
106 trans (0, 0) = evx (0, 0);
107 trans (1, 0) = evx (1, 0);
108 trans (2, 0) = evx (2, 0);
109 trans (0, 1) = evy (0, 0);
110 trans (1, 1) = evy (1, 0);
111 trans (2, 1) = evy (2, 0);
112 trans (0, 2) = evz (0, 0);
113 trans (1, 2) = evz (1, 0);
114 trans (2, 2) = evz (2, 0);
116 Eigen::Matrix4f homMatrix = Eigen::Matrix4f ();
117 homMatrix.setIdentity (4, 4);
118 homMatrix = transformPC.matrix ();
120 Eigen::Matrix4f trans_copy = trans.inverse ();
121 trans = trans_copy * center_mat * homMatrix;
142 sgurf (Eigen::Vector3f & centroid, Eigen::Vector3f & normal_centroid,
PointInTPtr & processed, std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > & transformations,
154 std::vector<int> &indices_in,
float threshold);
175 radius_normals_ = radius_normals;
218 cluster_tolerance_ = d;
227 eps_angle_threshold_ = d;
254 normalize_bins_ = normalize;
281 refine_clusters_ = rc;
288 getTransforms (std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > & trans)
300 valid = valid_transforms_;
331 float vpx_, vpy_, vpz_;
339 bool normalize_bins_;
342 float curv_threshold_;
345 float cluster_tolerance_;
348 float eps_angle_threshold_;
356 float radius_normals_;
359 float refine_clusters_;
361 std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > transforms_;
362 std::vector<bool> valid_transforms_;
365 float min_axis_value_;
393 std::vector<pcl::PointIndices> &clusters,
double eps_angle,
unsigned int min_pts_per_cluster = 1,
394 unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ());
408 #ifdef PCL_NO_PRECOMPILE
409 #include <pcl/features/impl/our_cvfh.hpp>
412 #endif //#ifndef PCL_FEATURES_VFH_H_
void getCentroidClusters(std::vector< Eigen::Vector3f > ¢roids)
Get the centroids used to compute different CVFH descriptors.
pcl::PointCloud< PointInT >::Ptr PointInTPtr
void compute(PointCloudOut &output)
Overloaded computed method from pcl::Feature.
void getTransforms(std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > &trans)
Returns the transformations aligning the point cloud to the corresponding SGURF.
std::string feature_name_
The feature name.
boost::shared_ptr< PointCloud< PointT > > Ptr
boost::shared_ptr< const OURCVFHEstimation< PointInT, PointNT, PointOutT > > ConstPtr
int k_
The number of K nearest neighbors to use for each point.
void filterNormalsWithHighCurvature(const pcl::PointCloud< PointNT > &cloud, std::vector< int > &indices_to_use, std::vector< int > &indices_out, std::vector< int > &indices_in, float threshold)
Removes normals with high curvature caused by real edges or noisy data.
std::vector< Eigen::Vector3f > centroids_dominant_orientations_
Centroids that were used to compute different OUR-CVFH descriptors.
void setMinPoints(size_t min)
Set minimum amount of points for a cluster to be considered.
void computeRFAndShapeDistribution(PointInTPtr &processed, PointCloudOut &output, std::vector< pcl::PointIndices > &cluster_indices)
Computes SGURF and the shape distribution based on the selected SGURF.
void setNormalizeBins(bool normalize)
Sets wether if the signatures should be normalized or not.
void getClusterIndices(std::vector< pcl::PointIndices > &indices)
Gets the indices of the original point cloud used to compute the signatures.
std::vector< Eigen::Vector3f > dominant_normals_
Normal centroids that were used to compute different OUR-CVFH descriptors.
void setRadiusNormals(float radius_normals)
Set the radius used to compute normals.
void setRefineClusters(float rc)
Sets the refinement factor for the clusters.
boost::shared_ptr< pcl::search::Search< PointT > > Ptr
void getCentroidNormalClusters(std::vector< Eigen::Vector3f > ¢roids)
Get the normal centroids used to compute different CVFH descriptors.
void getValidTransformsVec(std::vector< bool > &valid)
Returns a boolean vector indicating of the transformation obtained by getTransforms() represents a va...
void setClusterTolerance(float d)
Sets max.
void getClusterAxes(std::vector< short > &cluster_axes)
Gets the number of non-disambiguable axes that correspond to each centroid.
void setAxisRatio(float f)
Sets the min axis ratio between the SGURF axes to decide if disambiguition is feasible.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
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.
void getViewPoint(float &vpx, float &vpy, float &vpz)
Get the viewpoint.
Feature represents the base feature class.
void setEPSAngleThreshold(float d)
Sets max.
void setViewPoint(float vpx, float vpy, float vpz)
Set the viewpoint.
pcl::search::Search< PointNormal >::Ptr KdTreePtr
OURCVFHEstimation()
Empty constructor.
boost::shared_ptr< OURCVFHEstimation< PointInT, PointNT, PointOutT > > Ptr
void setMinAxisValue(float f)
Sets the min disambiguition axis value to generate several SGURFs for the cluster when disambiguition...
std::vector< short > cluster_axes_
Mapping from clusters to OUR-CVFH descriptors.
void setCurvatureThreshold(float d)
Sets curvature threshold for removing normals.
Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
std::vector< pcl::PointIndices > clusters_
Indices to the points representing the stable clusters.
OURCVFHEstimation estimates the Oriented, Unique and Repetable Clustered Viewpoint Feature Histogram ...
double search_radius_
The nearest neighbors search radius for each point.
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.