Page 1 of 1

how to fit a single shape to a point cloud

Posted: Fri Nov 11, 2016 12:55 pm
by sugerman
Daniel (et al.),

I love your software!!! I am trying to fit a single cylinder to a point cloud, to robustly measure its orientation. However when I use the RANSAC shape detection, it seems to replace the point cloud with the union of many cylinders to completely reproduce the entire cloud. Perhaps this issue is buried inside all the parameters for the algorithm, but is there a way to restrict the fitting to be just one single cylinder?

-ben

Re: how to fit a single shape to a point cloud

Posted: Fri Nov 11, 2016 1:08 pm
by daniel
Indeed, the algorithm finds many shapes by default. To reduce the number of detected shapes you have to increase the main parameter ('Min support points per primitive') to something bigger than half the number of points.

Re: how to fit a single shape to a point cloud

Posted: Fri Nov 11, 2016 1:36 pm
by sugerman
Thanks Daniel. Regrettably, the RANSAC fitting hits a 'segmentation failed' when I go that high. I have 185,717 points. However, tinkering with that value I did find that I could get just one cylinder. Thank you! I am thinking that it might a useful upgrade feature to allow the user to specify exactly how many of the geometric features they want fit?

-ben

Re: how to fit a single shape to a point cloud

Posted: Fri Nov 11, 2016 1:52 pm
by daniel
The Ransac Shape Detection library is quite old (2008) and has never been updated by its author ;)

But there are equivalents with other libraries. Hopefully we will have the time to update it in a not too far future.

Re: how to fit a single shape to a point cloud

Posted: Mon Feb 27, 2017 8:17 am
by tsyxulei
Hi daniel
Do you have time to update the cylinder fitting method ? If you add least square method to robust find cylinder, this will be hopefully for my application!
Thanks for your works