About the Tools->Fit->Sphere option

Feel free to ask any question here
Post Reply
jgpallero
Posts: 44
Joined: Thu Dec 12, 2013 2:00 pm

About the Tools->Fit->Sphere option

Post by jgpallero »

Hello:

I'm using CloudCompare 2.6.1 and I need to fix a cloud to a sphere using the Tools->Fit->Sphere option. If I apply the option several times to the same cloud, I obtain at each try a different solution (radius), so I can imagine that the option does not use all the points in the cloud (my cloud has approx. 80000 points). Does not use this option all the points? Which criteria uses for the selection?
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: About the Tools->Fit->Sphere option

Post by daniel »

The method uses a 'RANSAC' algorithm. It's a random process (a certain number of points is picked several times and the best match is returned - the number of points and the number of trials is given by some magical statistics formula ;). This way the process is relatively robust to noise.
Daniel, CloudCompare admin
jgpallero
Posts: 44
Joined: Thu Dec 12, 2013 2:00 pm

Re: About the Tools->Fit->Sphere option

Post by jgpallero »

daniel wrote:The method uses a 'RANSAC' algorithm. It's a random process (a certain number of points is picked several times and the best match is returned - the number of points and the number of trials is given by some magical statistics formula ;). This way the process is relatively robust to noise.
I suggest an option in order to select between RANSAC and using all points
ZilongS
Posts: 21
Joined: Tue Oct 09, 2018 8:12 pm

Re: About the Tools->Fit->Sphere option

Post by ZilongS »

daniel wrote: Thu Jul 16, 2015 1:41 pm The method uses a 'RANSAC' algorithm. It's a random process (a certain number of points is picked several times and the best match is returned - the number of points and the number of trials is given by some magical statistics formula ;). This way the process is relatively robust to noise.
Hello, Daniel,

I go through the forum to seek the algorithm used in CC for Tools->Fit->Sphere function, as you said essentially, it's a RANSAC function. However, I am wondering if a least-square solver has been implemented in CC for a plane or sphere fitting, or anywhere else? If not, do you intend to implement such a function, for exemple using Ceres Solver (http://ceres-solver.org/) for Non-linear Least Squares problems?

Thanks in advance for your reply.

Zilong S
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: About the Tools->Fit->Sphere option

Post by daniel »

We use here and there some conjugate gradient or Levenberg Marquardt algorithms (with Eigen).
Daniel, CloudCompare admin
ZilongS
Posts: 21
Joined: Tue Oct 09, 2018 8:12 pm

Re: About the Tools->Fit->Sphere option

Post by ZilongS »

daniel wrote: Thu Jun 06, 2019 7:24 pm We use here and there some conjugate gradient or Levenberg Marquardt algorithms (with Eigen).
The use of conjugate gradient or Levenberg Marquardt algorithms is interesting for me, can you specify where they are used in CC?

Thanks for that

Zilong
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: About the Tools->Fit->Sphere option

Post by daniel »

Conjugate gradient is very simple and actually used for a linear system A.X = b (sorry): https://github.com/CloudCompare/CloudCo ... Gradient.h

And for the Levenberg Marquardt algorithm, it's not in a public plugin... But the code can be found easily on the net: https://stackoverflow.com/questions/185 ... ementation
Daniel, CloudCompare admin
Post Reply