ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Point Feature Histograms Calculation.

asked 2013-04-02 14:15:40 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

To compute a single PFH representation from a k-neighborhood, we use:

computePointPFHSignature (const pcl::PointCloud<PointInT> &cloud,
                          const pcl::PointCloud<PointNT> &normals,
                          const std::vector<int> &indices,
                          int nr_split,
                          Eigen::VectorXf &pfh_histogram);

How can I calculate vector indices which represents the set of k-nearest neighbors from cloud?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-04-03 02:57:18 -0600

You might consider using the PFHEstimation class, as it already handles this for you. See the PCL tutorial here for more details.

If you want to do the search manually, you'll want to use the kdtree class for that, as shown in this tutorial:

int K = 10;
std::vector<int> KNNidx(K);
std::vector<float> KNNdist(K);
pcl::KdTreeFLANN<pcl::PointXYZ> kdtree;
for (int idx=0; idx<cloud.size(); ++idx) {
  kdtree.nearestKSearch(cloud, idx, K, KNNidx, KNNdist);
  computePointPFHSignature(cloud, normals, KNNidx, nr_split, pfh_hist); something with pfh_hist...
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-04-02 14:15:40 -0600

Seen: 291 times

Last updated: Apr 03 '13