'How do you find multiple planes in a 3D pointcloud?

I am looking to find all the planes in a 3D pointcloud using PCL. The example snippet has a video showing two different planes detected:

http://pointclouds.org/documentation/tutorials/planar_segmentation.php

But if I look at the source code snippet I think it assumes that there is only one plane in the point cloud.

Is it possible to use PCL to detect all the planar sections in a point cloud using RANSAC?



Solution 1:[1]

Have a look at this cluster extraction tutorial. From line 44 to line 69 you can see how "all" planes are removed from the cloud. The trick is to set the filter to negative .setNegative(true) to extract the cloud without the planar surface.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1