PCL源码分析-pcl/filter/sampling_surface_normal.h

sampling_surface_normal关键点介绍

/** \brief @b SamplingSurfaceNormal divides the input space into grids until each grid contains a maximum of N points,
* and samples points randomly within each grid. Normal is computed using the N points of each grid. All points
* sampled within a grid are assigned the same normal.
*
* \author Aravindhan K Krishnan. This code is ported from libpointmatcher (https://github.com/ethz-asl/libpointmatcher)
* \ingroup filters
*/
SamplingSurfaceNormal将输入空间划分为多个网格,直到每个网格最多包含N个点,并在每个网格中随机采样点。 使用每个网格的N个点计算法线。 在网格内采样的所有点都分配有相同的法线。
作者:Aravindhan K Krishnan。
此代码从libpointmatcher(https://github.com/ethz-asl/libpointmatcher)分组过滤器中移植

主要函数

      /** \brief Set maximum number of samples in each grid 设置每个网格中的最大样本数
        * \param[in] sample maximum number of samples in each grid
        */
      inline void
      setSample (unsigned int sample)
      {
   
        sample_ = sample;
      }
      /** \brief Set seed of random function.设置随机函数的种子。
        * \param[in] seed the input seed
        */
      inline void
      setSeed (unsigned int seed)
      {
   
        seed_ = seed;
        srand (seed_);
      }
      /** \brief Set ratio of points to be sampled in each grid设置每个网格中要采样的点的比例
        * \param[in] ratio sample the ratio of points to be sampled in each grid
        */
      inline void
      setRatio (float ratio)
      {
   
        ratio_ = ratio;
      }

完整代码

# include "../include/sd_descriptors_bit.h"

typedef pcl::PointXYZ PointType;
typedef pcl::PointNormal PointNormalType;
typedef pcl::Normal NormalType;

class keypoints {
   
public:
	pcl::PointCloud<PointType>				cloud1, cloud2;
	pcl::PointCloud<NormalType>				cloud1_normals, cloud2_normals;
	pcl::PointCloud<PointNormalType>		cloud1_point_normals, cloud2_point_normals;
	pcl::PointCloud<PointType>				cloud1_k
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

DoubleYuanL

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值