承德做网站优化,自己做网站好做么,北京家居网站建设,贸易网站建设PFH的理论上的时间复杂度是O(nk的平方)#xff0c;n是点的数量#xff0c;k是最近邻的个数。对于实时系统来说#xff0c;这压根就是不行的#xff0c;所以作为PFH规划的简化版本#xff0c;FPFH把计算复杂度减少成O(nk),但是还具有很好的和PFH差不多的区分能力。
第一步…PFH的理论上的时间复杂度是O(nk的平方)n是点的数量k是最近邻的个数。对于实时系统来说这压根就是不行的所以作为PFH规划的简化版本FPFH把计算复杂度减少成O(nk),但是还具有很好的和PFH差不多的区分能力。
第一步我们先计算了每个查询点Pq的一系列值并把它叫做SPFH(Simplified Point Feature Histgram)
第二步每个点的最近邻是重新分配SPFH值将用来权衡FPFH的值: 这里的Wk代表了两点的距离。权重(weight)的组合是非常重要的下面的图显示了这一点: 可以看到越近的权重越大线越粗。
因此给定一个点Pq,这个算法第一步评估了SPFH的值通过创造它和它的近邻的匹配。这个过程将一直重复通过近邻SPFH的值不停的改变权重最终生成了Pq的FPFH。
PFH与FPFH之间的差异
1.FPFH没有和它所有的近邻有着联系因此可能会丢失一些值的匹配。
2.PFH模型可以更精确的描述表面而FPFH则包括了额外的点的配对在半径为r的圆的外面(最多不会超过2r)
3.因为权重的组合FPFH结合了SPFH的值并且重新获取了一些点的近邻。
4.FPFH复杂度大大降低计算更快。
5.最终的直方图是简化了。 预估FPFH的特征值
FPFH的执行使用了11个分发的子区间和一个非相关的组合(33位的数组)把它存在pcl::FPFHSignature33这个点类型里面。
下面的代码段预估了一个所有点的FPFH的特征集合
#include pcl/point_types.h
#include pcl/features/fpfh.h
{
pcl::PointCloudpcl::PointXYZ::Ptr cloud (new pcl::PointCloudpcl::PointXYZ);
pcl::PointCloudpcl::Normal::Ptr normals (new pcl::PointCloudpcl::Normal ());
... read, pass in or create a point cloud with normals ...
... (note: you can create a single PointCloudPointNormal if you want) ...
// Create the FPFH estimation class, and pass the input datasetnormals to it
pcl::FPFHEstimationpcl::PointXYZ, pcl::Normal, pcl::FPFHSignature33 fpfh;
fpfh.setInputCloud (cloud);
fpfh.setInputNormals (normals);
// alternatively, if cloud is of tpe PointNormal, do fpfh.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::KdTreePointXYZ::Ptr tree (new pcl::search::KdTreePointXYZ);
fpfh.setSearchMethod (tree);
// Output datasets
pcl::PointCloudpcl::FPFHSignature33::Ptr fpfhs (new pcl::PointCloudpcl::FPFHSignature33 ());
// Use all neighbors in a sphere of radius 5cm
// IMPORTANT: the radius used here has to be larger than the radius used to estimate the surface normals!!!
fpfh.setRadiusSearch (0.05);
// Compute the features
fpfh.compute (*fpfhs);
// fpfhs-points.size () should have the same size as the input cloud-points.size ()*
}
调用FPFHEstimation时实际做了这么几步
1.PFH的步骤
2.使用每个SPFH通过一个权重组合来赋值给FPFH。
类似于PFH我们可以把这段代码反正compute()函数前进行优化
for (int i 0; i normals-points.size(); i)
{
if (!pcl::isFinitepcl::Normal(normals-points[i]))
{
PCL_WARN(normals[%d] is not finite\n, i);
}
}
我们可以用OpenMP进行优化
使用OpenMP可以进行多线程计算。类名叫做pcl::FPFHEstimationOMP,