PCL学习笔记——Pcl::PointCloud和pcl::PointCloud::Ptr类型的转换

加了ptr的是指针类型,两者可以互相转换

1.PointCloud::Ptr—>PointCloud

pcl::PointCloud cloud;
pcl::PointCloud::Ptr cloud_ptr(new pcl::PointCloud);
cloud=*cloud_ptr;

2.PointCloud—>PointCloud::Ptr

pcl::PointCloud::Ptr cloud_ptr(new pcl::PointCloud);
pcl::PointCloud cloud;
cloud_ptr=cloud.makeShared();

example:

1.
pcl::PointCloud cloudA;
pcl::octree::OctreePointCloudSearch octree(resolution);  
octree.setInputCloud(cloudA.makeShared());

2.
pcl::PointCloud::Ptr cloudA(new pcl::PointCloud);
pcl::octree::OctreePointCloudSearch octree(resolution); 
octree.setInputCloud(cloudA);

你可能感兴趣的:(PCL学习,PCL学习笔记)