VFH(視點特徵直方圖)描述子,能夠應用在點雲聚類識別和六自由度位姿估計問題。最終計算獲得的VFH點雲大小爲1,即vfhs->points.size()=1.php
http://www.pointclouds.org/documentation/tutorials/vfh_estimation.php#vfhide
#include <pcl/point_types.h> #include <pcl/features/vfh.h> { pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>); pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal> ()); ... read, pass in or create a point cloud with normals ... ... (note: you can create a single PointCloud<PointNormal> if you want) ... // Create the VFH estimation class, and pass the input dataset+normals to it pcl::VFHEstimation<pcl::PointXYZ, pcl::Normal, pcl::VFHSignature308> vfh; vfh.setInputCloud (cloud); vfh.setInputNormals (normals); // alternatively, if cloud is of type PointNormal, do vfh.setInputNormals (cloud); // Create an empty kdtree representation, and pass it to the FPFH estimation object. // Its content will be filled inside the object, based on the given input dataset (as no other search surface is given). pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ> ()); vfh.setSearchMethod (tree); // Output datasets pcl::PointCloud<pcl::VFHSignature308>::Ptr vfhs (new pcl::PointCloud<pcl::VFHSignature308> ()); // Compute the features vfh.compute (*vfhs); // vfhs->points.size () should be of size 1* }