【PCL点云库|法向量】pcl::Normal 和 pcl::PointNormal 的区别

2023-05-16

表示法向坐标和表面曲率估计的点结构。

/** \brief A point structure representing normal coordinates and the surface curvature estimate. (SSE friendly)
  * \ingroup common
  */
struct Normal : public _Normal
{
  inline Normal (const _Normal &p)
  {
    normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
    data_n[3] = 0.0f;
    curvature = p.curvature;
  }

  inline Normal (float _curvature = 0.f): Normal (0.f, 0.f, 0.f, _curvature) {}

  inline Normal (float n_x, float n_y, float n_z, float _curvature = 0.f)
  {
    normal_x = n_x; normal_y = n_y; normal_z = n_z;
    data_n[3] = 0.0f;
    curvature = _curvature;
  }

  friend std::ostream& operator << (std::ostream& os, const Normal& p);
  PCL_MAKE_ALIGNED_OPERATOR_NEW
};

表示欧几里得xyz坐标以及法向坐标和表面曲率估计的点结构。

/** \brief A point structure representing Euclidean xyz coordinates, together with normal coordinates and the surface curvature estimate. (SSE friendly)
  * \ingroup common
  */
struct PointNormal : public _PointNormal
{
  inline PointNormal (const _PointNormal &p)
  {
    x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
    normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
    curvature = p.curvature;
  }

  inline PointNormal (float _curvature = 0.f): PointNormal (0.f, 0.f, 0.f, 0.f, 0.f, 0.f, _curvature) {}

  inline PointNormal (float _x, float _y, float _z):
    PointNormal (_x, _y, _z, 0.f, 0.f, 0.f, 0.f) {}

  inline PointNormal (float _x, float _y, float _z, float n_x, float n_y, float n_z, float _curvature = 0.f)
  {
    x = _x; y = _y; z = _z;
    data[3] = 1.0f;
    normal_x = n_x; normal_y = n_y; normal_z = n_z;
    data_n[3] = 0.0f;
    curvature = _curvature;
  }

  friend std::ostream& operator << (std::ostream& os, const PointNormal& p);
};
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【PCL点云库|法向量】pcl::Normal 和 pcl::PointNormal 的区别 的相关文章

随机推荐