Page 1 of 1
About the Tools->Fit->Sphere option
Posted: Thu Jul 16, 2015 12:57 pm
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?
Re: About the Tools->Fit->Sphere option
Posted: Thu Jul 16, 2015 1:41 pm
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.
Re: About the Tools->Fit->Sphere option
Posted: Thu Jul 16, 2015 1:44 pm
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
Re: About the Tools->Fit->Sphere option
Posted: Tue Jun 04, 2019 7:50 am
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
Re: About the Tools->Fit->Sphere option
Posted: Thu Jun 06, 2019 7:24 pm
by daniel
We use here and there some conjugate gradient or Levenberg Marquardt algorithms (with Eigen).
Re: About the Tools->Fit->Sphere option
Posted: Wed Jun 12, 2019 9:56 pm
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
Re: About the Tools->Fit->Sphere option
Posted: Thu Jun 13, 2019 5:57 pm
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