Ask Your Question
0

Getting Error in OrganizedMultiPlaneSegmentation.

asked 2013-05-06 02:19:21 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I tried to use use OrganizedMultiPlaneSegmentation, but I got an error. Error msg is like "error C2664: 'void pcl::OrganizedMultiPlaneSegmentation<pointt,pointnt,pointlt>::segmentAndRefine(std::vector<_Ty,_Ax> &)' : cannot convert parameter 1 from 'std::vector<_Ty>' to 'std::vector<_Ty,_Ax> &'" Here is my sample code. Your advice is most appreciable. Thanx in advance.

int main(..) 
{ 
//Load point cloud. 

pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>); 
pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne; 
ne.setInputCloud (cloud.makeShared()); 
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ> ()); 
ne.setSearchMethod (tree); 
int k=3; 
ne.setKSearch(k); 
ne.compute (*normals); 

pcl::OrganizedMultiPlaneSegmentation<pcl::PointXYZ,pcl::Normal,pcl::Label>mps; //Error 
mps.setMinInliers(1000); 
mps.setAngularThreshold(0.017453*2.0); 
mps.setDistanceThreshold(0.02); 
mps.setInputNormals(normals); 
mps.setInputCloud(cloud.makeShared()); 
std::vector<pcl::PlanarRegion<pcl::PointXYZ>>regions;//Error 
mps.segmentAndRefine(regions); //Error 
}
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-03-31 07:53:50 -0600

Amir Shantia gravatar image

This is pretty old, but since I was looking for an answer on a similar topic, here is your solution.

std::vector<pcl::PlanarRegion<PointT>, Eigen::aligned_allocator<pcl::PlanarRegion<PointT> > > regions;

The regions are not actual points but only sort of a boundary. If you want XYZ you need to use the other overload of the segmentAndRefine option.

edit flag offensive delete link more
0

answered 2015-11-14 16:54:15 -0600

kerollosghobrial gravatar image

this is my code and i got this errors :

[pcl::OrganizedMultiPlaneSegmentation::segment] Organized point cloud is required for this plane extraction method! code:

pcl::search::KdTree<pcl::pointxyz>::Ptr kdtree(new pcl::search::KdTree<pcl::pointxyz>); pcl::NormalEstimation<pcl::pointxyz, pcl::normal=""> normalEstimation;

pcl::PointCloud <pcl::normal>::Ptr normals (new pcl::PointCloud <pcl::normal>); normalEstimation.setInputCloud(cloud); normalEstimation.setSearchMethod(kdtree); normalEstimation.setKSearch(3); normalEstimation.compute(*normals);

pcl::OrganizedMultiPlaneSegmentation< pcl::PointXYZ, pcl::Normal, pcl::Label > mps; mps.setMinInliers (10000); mps.setInputNormals(normals); mps.setAngularThreshold (0.017453 * 2.0); mps.setDistanceThreshold (0.02);

std::vector<pcl::planarregion<pcl::pointxyz>,Eigen::aligned_allocator<pcl::planarregion<pcl::pointxyz> > > regions; mps.setInputCloud (cloud); mps.segment(regions);
ROS_INFO_STREAM("the number of regions: " << regions.size ()); is there anyone can help me to solve this problem, i really appreciate that. tanks in advance.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-05-06 02:19:21 -0600

Seen: 920 times

Last updated: Nov 14 '15