基础知识2:PCL中pcl::PointCloud::Ptr 和Pcl::PointCloud两个类的相互转换

1:Ptr类型和非Ptr类型相互转换

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

2: 实际的使用:a)非Ptr

 
  
pcl::PointCloud cloud;
pcl::SACSegmentationseg;
****中间是点云分割的参数设置(省略)*****
seg.setInputCloud(cloud.makeShared());

b)Ptr 动态智能指针类型

pcl::PointCloud cloud(new pcl::PointCloud);
pcl::SACSegmentationseg;
****中间是点云分割的参数设置(省略)*****
seg.setInputCloud(cloud);

你可能感兴趣的:(PCL)