PCL八叉树 getPointIndicesFromNewVoxels 点云比对

本文介绍如何使用PCL中的八叉树结构(OctreePointCloudChangeDetector)来检测两个点云(cloudA和B)之间的差异,重点在于找出B中不属于A的点。通过维护两个缓冲区并重用节点对象,减少了内存分配和释放操作,提高了效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

查找B点云中 不属于A点云的点
Point cloud cloudA is our reference point cloud and the octree structure describe its spatial distribution. The class OctreePointCloudChangeDetector inherits from class Octree2BufBase which enables to keep and manage two octrees in the memory at the same time. In addition, it implements a memory pool that reuses already allocated node objects and therefore reduces expensive memory allocation and deallocation operations when generating octrees of multiple point clouds. By calling “octree.switchBuffers()”, we reset the octree class while keeping the previous octree structure in memory.

#include <pcl/point_cloud.h>
#include <pcl/octree/octree_pointcloud_changedetector.h>
#include<iostream>
#include<vector>
#include<ctime>
#include <pcl/visualization/pcl_visualizer.h>
 


int main(int argc, char** argv)
{
   


	//In order to retrieve points that are stored at voxels of the current octree structure (based on cloudB) which did not exist in the previous octree structure (based on cloudA),


	srand((unsigned int) time(NULL));

	float resolution = 32.0f;

	pcl::octree::OctreePointCloudChangeDetector < pcl::PointXYZ> octree(resolution);
	pcl::PointCloud < pcl::PointXYZ>::Ptr cloudA(new  pcl::PointCloud<pcl::PointXYZ>());


	cloudA->width = 128;
	cloudA->height = 1;
	cloudA->resize(cloudA-></
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值