Linear Least Squares Fit of Sphere to Points

后端 未结 5 424
無奈伤痛
無奈伤痛 2020-12-31 16:10

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

相关标签:
5条回答
  • 2020-12-31 16:49

    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.

    0 讨论(0)
  • 2020-12-31 16:49

    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.

    0 讨论(0)
  • 2020-12-31 16:55

    Difficult to do this without iteration.

    I would proceed as follows:

    1. find the overall midpoint, by averaging (X,Y,Z) coords for all points

    2. with that result, find the average distance Ravg to the midpoint, decide ok or proceed..

    3. remove points from your set with a distance too far from Ravg found in step 2

    4. go back to step 1 (average points again, yielding a better midpoint)

    Of course, this will require some conditions for (2) and (4) that depends on the quality of your points cloud !

    0 讨论(0)
  • 2020-12-31 16:57

    Short description of making matrix equation could be found here.

    I've seen that WildMagic Library uses iterative method (at least in version 4)

    0 讨论(0)
  • 2020-12-31 17:14

    You may be interested by the best fit d-dimensional sphere, i.e. minimizing the variance of the population of the squared distances to the center; it has a simple analytical solution (matrix calculus): see the appendix of the open access paper of Cerisier et al. in J. Comput. Biol. 24(11), 1134-1137 (2017), https://doi.org/10.1089/cmb.2017.0061 It works when the data points are weighted (it works even for continuous distributions; as a by-product, when d=1, a well-known inequality is retrieved: the kurtosis is always greater than the squared skewness plus 1).

    0 讨论(0)
提交回复
热议问题