how to fit a single shape to a point cloud

Feel free to ask any question here
Post Reply
sugerman
Posts: 4
Joined: Thu Nov 10, 2016 8:01 pm

how to fit a single shape to a point cloud

Post 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
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

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

Post 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.
Daniel, CloudCompare admin
sugerman
Posts: 4
Joined: Thu Nov 10, 2016 8:01 pm

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

Post 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
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

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

Post 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.
Daniel, CloudCompare admin
tsyxulei
Posts: 17
Joined: Wed Sep 25, 2013 6:13 am

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

Post 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
Post Reply