Tools>Fit>Plane and RANSAC

Feel free to ask any question here
ripo
Posts: 9
Joined: Sat Mar 28, 2015 9:02 am

Tools>Fit>Plane and RANSAC

Post by ripo »

Hello Daniel,
I’m using cloudcompare for my thesis and I have a problem. I have to find the best plane to fit a point cloud. The software allows you to use two methods (at least I think so): tools> fit> plane and RANSAC.
My questions are: what is the difference between two commands? what criteria the two commands inserts the fit plane? which command inserts a better plane?
Thank You!!!
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Tools>Fit>Plane and RANSAC

Post by daniel »

In fact the 'Fit' method uses all the points of the selected cloud and fit a single plane.

The 'Ransac Shape Detection' plugin fits one or several planes (and other primitives) by randomly selecting some points in the input cloud. You can set their number with the plugin parameters dialog. But as it's a random process. It's better suited if you are looking for many planes and you don't need a reproducible process with full control.
Daniel, CloudCompare admin
ripo
Posts: 9
Joined: Sat Mar 28, 2015 9:02 am

Re: Tools>Fit>Plane and RANSAC

Post by ripo »

Thanks for the answer!
I would like to know how the software inserts the plane with "Fit" method. It uses a linear regression for example?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Tools>Fit>Plane and RANSAC

Post by daniel »

Indeed, it's a standard least square fitting (based on the eigenvalues and vectors of the covariance matrix to be precise ;).
Daniel, CloudCompare admin
ripo
Posts: 9
Joined: Sat Mar 28, 2015 9:02 am

Re: Tools>Fit>Plane and RANSAC

Post by ripo »

I try to set the parameters of RANSAC method in plugin parameters dialog. Each point cloud selected has a different set of parameters. For example a point cloud has automatically the parameter e=0.053 and another point cloud has e=0.045. Why are there different values? What causes different parameters?
Thank you very much for your support!
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Tools>Fit>Plane and RANSAC

Post by daniel »

Because it's a default guess based on the cloud bounding-box. If you have a good value you should use it instead.
Daniel, CloudCompare admin
ripo
Posts: 9
Joined: Sat Mar 28, 2015 9:02 am

Re: Tools>Fit>Plane and RANSAC

Post by ripo »

This is the problem. If I can understand which parameters are good, the problem is solved otherwise I have to change them. What do you mean by "good value"?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Tools>Fit>Plane and RANSAC

Post by daniel »

In truth the parameter 'e' depends on the units of your cloud, the level of noise, etc. Only the user can determine it correctly. But I didn't say it's easy ;)
Daniel, CloudCompare admin
ripo
Posts: 9
Joined: Sat Mar 28, 2015 9:02 am

Re: Tools>Fit>Plane and RANSAC

Post by ripo »

I read some articles on RANSAC method. It is based on two kind of points: inliers and outliers. I have a question on the parameter "e" in plugin parameters dialog. Is the parameter "e" the size of "inliers box"? Or includes it outliers point so and in a second moment make the division from this two data?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Tools>Fit>Plane and RANSAC

Post by daniel »

It would be best to look at the "Ransac Shape Detection" article:
http://cg.cs.uni-bonn.de/en/publication ... efficient/

In the article 'e' corresponds to the 'epsilon' symbol (and it's the 'max distance to primitive' as recalled in the tool dialog... so basically the max distance to consider a point as being an 'inlier' point).
Daniel, CloudCompare admin
Post Reply