PCL点云去背景(相减)的方法

本文介绍了使用PCL库中的octree方法进行点云背景去除。通过修改官方教程代码,可以检测出点云B相对于点云A新增的点,从而实现去背景效果。前提条件是两云坐标系相同,否则需先进行配准。此外,还提及了其他方法,如求交集配合配准来完成点云背景去除。
摘要由CSDN通过智能技术生成

官网的教程中有一个octree的例子,可以实现这个功能
https://pcl.readthedocs.io/projects/tutorials/en/latest/octree_change.html#octree-change-detection

例子中能检测出点云B在点云A上增加的点,但不能检测出减少的点,如果A为背景,B为包含背景和其他物体的点云,那么可以实现在B中去背景的作用,下面的代码对官网的代码做了简单的修改,B的前100个点和A近似相同,后面的是新加的不同的点,结果后面的点都检测出来了。当然前提条件是两个点云坐标系相同,否则需要先做配准。,在配准的时候也可以直接求交集,见本文最后。

// modified from the code in https://pcl.readthedocs.io/projects/tutorials/en/latest/octree_change.html#octree-change-detection
#include <pcl/point_cloud.h>
#include <pcl/octree/octree_pointcloud_changedetector.h>

#include <iostream>
#include <vector>
#include <ctime>

int
main (int argc, char** argv)
{
   
  srand ((unsigned int) time (NULL));

  // Octree resolution - side length of octree voxels
  float resolution = 32.0f;

  // Instantiate octree-based point cloud change detection class
  pcl::octree::OctreePointCloudChangeDetector<pcl::PointXYZ> octree (resolution);

  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值