问题
I'm looking for an algorithm to find the best fit between a cloud of points and a sphere.
That is, I want to minimise
where C is the centre of the sphere, r its radius, and each P a point in my set of n points. The variables are obviously Cx, Cy, Cz, and r. In my case, I can obtain a known r beforehand, leaving only the components of C as variables.
I really don't want to have to use any kind of iterative minimisation (e.g. Newton's method, Levenberg-Marquardt, etc) - I'd prefer a set of linear equations or a solution explicitly using SVD.
回答1:
There are no matrix equations forthcoming. Your choice of E is badly behaved; its partial derivatives are not even continuous, let alone linear. Even with a different objective, this optimization problem seems fundamentally non-convex; with one point P and a nonzero radius r, the set of optimal solutions is the sphere about P.
You should probably reask on an exchange with more optimization knowledge.
回答2:
Short description of making matrix equation could be found here.
I've seen that WildMagic Library uses iterative method (at least in version 4)
回答3:
The linked thesis contains a problem : it doesn't handle noise properly and overestimates the radius. (Centre is OK). It looks like it should be possible to come up with a correction based upon the estimate of the applied noise.
来源:https://stackoverflow.com/questions/10344119/linear-least-squares-fit-of-sphere-to-points