pcl中的PFH和FPFH

PFH

点特征直方图计算方式

在这里插入图片描述
在这里插入图片描述
注意
这里图上标注的角度并不是真实的角度,而是对应角度的余弦值(按理说是内积,但是模长都是1),可以从这个代码中的pcl::computePairFeatures函数看出:

bool
pcl::computePairFeatures (const Eigen::Vector4f &p1, const Eigen::Vector4f &n1, 
                          const Eigen::Vector4f &p2, const Eigen::Vector4f &n2,
                          float &f1, float &f2, float &f3, float &f4)
{
  Eigen::Vector4f dp2p1 = p2 - p1;
  dp2p1[3] = 0.0f;
  f4 = dp2p1.norm ();

  if (f4 == 0.0f)
  {
    PCL_DEBUG ("[pcl::computePairFeatures] Euclidean distance between points is 0!\n");
    f1 = f2 = f3 = f4 = 0.0f;
    return (false);
  }

  Eigen::Vector4f n1_copy = n1,
                  n2_copy = n2;
  n1_copy[3] = n2_copy[3] = 0.0f;
  float angle1 = n1_copy.dot (dp2p1) / f4;

  // Make sure the same point is selected as 1 and 2 for each pair
  float angle2 = n2_copy.dot (dp2p1) / f4;
  if (std::acos (std::fabs (angle1)) > std::acos (std::fabs (angle2)))
  {
    // switch p1 and p2
    n1_copy = n2;
    n2_copy = n1;
    n1_copy[3] = n2_copy[3] = 0.0f;
    dp2p1 *= (-1);
    f3 = -angle2;
  }
  else
    f3 = angle1;

  // Create a Darboux frame coordinate system u-v-w
  // u = n1; v = (p_idx - q_idx) x u / || (p_idx - q_idx) x u ||; w = u x v
  Eigen::Vector4f v = dp2p1.cross3 (n1_copy);
  v[3] = 0.0f;
  float v_norm = v.norm ();
  if (v_norm == 0.0f)
  {
    PCL_DEBUG ("[pcl::computePairFeatures] Norm of Delta x U is 0!\n");
    f1 = f2 = f3 = f4 = 0.0f;
    return (false);
  }
  // Normalize v
  v /= v_norm;

  Eigen::Vector4f w = n1_copy.cross3 (v);
  // Do not have to normalize w - it is a unit vector by construction

  v[3] = 0.0f;
  f2 = v.dot (n2_copy);
  w[3] = 0.0f;
  // Compute f1 = arctan (w * n2, u * n2) i.e. angle of n2 in the x=u, y=w coordinate system
  f1 = std::atan2 (w.dot (n2_copy), n1_copy.dot (n2_copy)); // @todo optimize this

  return (true);
}

vector组合方式

pcl中对其实现使用了三个角度,而没有使用长度,对每一个角度划分为5个区域(bin),然后接下来就是将这3种特征的5个Bin组合成一个vector,有两张方式:

  1. 将这个5*3个bin直接组合在一块,特征只有15个值,最终的直方图横轴就只有15个坐标.FPFH就是采用的这种方式
  2. 讲这3种特征按照各自的阈值分为5类,一共分为15类.比如第一对点的特征为:3,4,4,然后根据5进制转10进制的方式,将其转为10进制数:3x1+4x5+4x25=123.因此,这种方式会有125个横坐标值.FPH就是采用的这种方式

第二种的计算方式如下:
在这里插入图片描述pcl中采用3个角度特征,bin设为5,采用10进制计数,最终为555=125

The default PFH implementation uses 5 binning subdivisions (e.g., each of the four feature values will use this many bins from its value interval), and does not include the distances (as explained above – although the computePairFeatures method can be called by the user to obtain the distances too, if desired) which results in a 125-byte array (5^3) of float values. These are stored in a pcl::PFHSignature125 point type.

FPFH

FAST点特征直方图计算方式

在这里插入图片描述pcl中对FPFH的实现依旧使用了3个角度,但是对bin的划分提升到了11个区域,feature vector的组合方式采用了直接拼接的方式所以为33

The default FPFH implementation uses 11 binning subdivisions (e.g., each of the four feature values will use this many bins from its value interval), and a decorrelated scheme (see above: the feature histograms are computed separately and concantenated) which results in a 33-byte array of float values. These are stored in a pcl::FPFHSignature33 point type.

参考

PFH
FPFH

搭配PCL点云配准FPFH特征是一种常用的方法。FPFH特征是一种由点对间的特征来描述点云的局部形状信息的描述子。它的计算步骤如下: 首先,根据输入的点云数据建立一个k-最近邻(k-Nearest Neighbor,kNN)搜索结构。 接下来,对每个点,找到其最近的k个邻居点。 然后,计算每个点的法向量,并对其进行归一化。 之后,将每个点与其邻域内的每个邻居点进行连接,形成一个点对集合。 最后,计算每个点对的一个特征向量,其包含了方向角、高度角和距离差等信息。 将FPFH特征用于点云配准的步骤如下: 首先,将待配准的源点云和目标点云分别计算出各自的FPFH特征。 然后,使用一种配准算法(例如ICP)对源点云和目标点云进行初始配准。 接下来,根据源点云和目标点云的FPFH特征,计算两者之间的匹配关系。 然后,根据匹配关系对源点云和目标点云进行进一步的配准,并优化其刚体变换的参数。 最后,根据优化后的刚体变换参数对源点云进行配准。 通过搭配PCL点云配准FPFH特征,可以有效地进行点云的配准任务。它能够提取出点云的局部形状信息,并通过匹配关系计算出点云的刚体变换参数,从而实现点云的准确配准。同时,FPFH特征具有计算简单、鲁棒性强等特点,可以适用于各种类型的点云数据。因此,搭配PCL点云配准之FPFH特征是一种常用且有效的方法。
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Tech沉思录

点赞加投币,感谢您的资瓷~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值