查找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-></