视点特征直方图(VFH)描述子

视点特征直方图(VFH)源于FPFH描述子。由于其获取速度和识别力,我们决定利用FPFH的强大识别力,但为了使构造的特征保持缩放不变性的性质的同时,还要区分不同的位姿,计算时需要考虑加入视点变量。我们做了以下两种计算来构造特征,以应用于目标识别问题和位姿估计:
(1)拓展FPFH,使其利用整个点云对象来进行计算估计,在计算FPFH时以物体为物体中心点与物体表面其他所有点之间的点作为计算但元。
(2)添加视点方向与每个点估计法线之间额外的统计信息,为了达到这个目的,我们的关键思想时在FPFH计算中将视点方向变量直接融入到相对法线角计算中。

通过统计视点方向与每个法线之间角度的直方图来计算视点相关的特征分量。注意,并非每条法线的视角,因为法线的视角在尺度变换下具有可变性,我们指的是平移视点到查询点后的视角方向和每条法线仙剑的角度。第二组特征分量就是PFH中的三个角度,只是现在测量的是在中心点的视点方向和每条表面法线之间的角度。
因此新组合的特征被称为视点特征直方图(VFH)。下图表现的就是新特征的想法,包含以下两部分:
(1)一个视点方向相关的分量
(2)一个包含拓展FPFH的描述表面形状的分量

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <pcl/point_types.h>
#include <pcl/features/normal_3d.h>
#include <pcl/io/pcd_io.h>
#include <pcl/features/fpfh.h>
#include <pcl/features/vfh.h>
#include <pcl/search/kdtree.h>

int main() {
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
pcl::io::loadPCDFile("bunny.pcd",*cloud);
pcl::PointCloud<pcl::Normal>::Ptr normal(new pcl::PointCloud<pcl::Normal>);
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZ>);
pcl::NormalEstimation<pcl::PointXYZ,pcl::Normal> ne;
ne.setInputCloud(cloud);
ne.setRadiusSearch(0.03);
ne.setSearchMethod(tree);
ne.compute(*normal);

pcl::VFHEstimation<pcl::PointXYZ,pcl::Normal,pcl::VFHSignature308> vfh;
vfh.setInputCloud(cloud);
vfh.setInputNormals(normal);
vfh.setRadiusSearch(0.05);
vfh.setSearchMethod(tree);
pcl::PointCloud<pcl::VFHSignature308>::Ptr vfhs(new pcl::PointCloud<pcl::VFHSignature308>);
for (int i = 0; i < normal->size(); ++i) {
if (!pcl::isFinite<pcl::Normal>((*normal)[i]))
PCL_WARN("normal [%d] is not finite \n",i);
}
vfh.compute(*vfhs);
std::cout << "compute finished!" << std::endl;
return 0;
}

感谢您的阅读。 🙏 关于转载请看这里