0

From PCL I am using SACSegmentation function in order to find a specific shape from a Point Cloud. One of the options I wish to use is called setSamplesMaxDist(A,B). A is the radius (double variable) while B is set with SearchPtr.

I am not sure how to initialize SearchPtr.

I have already tried setting pcl::search::Search<PointT>::Ptr B, the Build of which crashed during start up. When I tried pcl::search::Search<PointT>::Ptr B(new search::Search<PointT>), Visual Studio would not allow me.

So what is the proper way?

Mark Loyman
  • 1,983
  • 1
  • 14
  • 23

1 Answers1

0

pcl::search::Search is the interface that all search classes inherit from.

You need to use one of the concrete implementations.

Example using KdTree:

pcl::search::KdTree<pcl::PointXYZRGBNormal>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZRGBNormal>);
tree->setInputCloud(cloud);

pcl::SACSegmentation<pcl::PointXYZRGBNormal> seg;
seg.setSamplesMaxDist(radius, tree);
Mark Loyman
  • 1,983
  • 1
  • 14
  • 23