Indefinite planes segmentation

asked 2016-02-07 21:48:44 -0500

Nxzx gravatar image


I'm trying to segment walls in the best possible way, but sometimes I have 4 planes and sometimes 2 or 3 in front of my sensor. How could I segment the planes using RANSAC and set the algorithm to find the exact X number of the planes I have in front of my sensor? If I use a iterator with a fixed number of iterations sometimes the algorithm will catch small planes I don't need.

For example: If I have 4 planes, I want to find those 4 planes and stop the iterator after find those 4.

If I have only 2 I want to find those 2 and stop the iterator after find those 2.

I can use the indices to dispose some small planes I don't want, but if I use indices.size() == 0 the algorithm will cath very small planes. What is the indices.size() of a wall measuring 2m wide for 1m height?

if (inlierIndices->indices.size() == 0) { std::cout << "Could not find a plane in the scene." << std::endl; return false; }


edit retag flag offensive close merge delete


Thsi is not a question for ROS, but maybe PCL users lists. Anyway, I get the feeling that you are not understanding how PCL Ransac works, AFAIK it will return largest planes first. In the plane detection example they do a for until the final cloud is small. Just change that for loop.

Javier V. Gómez gravatar image Javier V. Gómez  ( 2016-02-08 06:14:17 -0500 )edit