Fitting an ellipsoid to 3D data points

前端 未结 9 1529
终归单人心
终归单人心 2021-02-09 07:44

I have a large set of 3D data points to which I want to fit to an ellipsoid.

My maths is pretty poor, so I\'m having trouble implementing the least squares method withou

9条回答
  •  执念已碎
    2021-02-09 08:07

    I could not find a good Java based algorithm for fitting an ellipsoid, so I ended up writing it myself. There were some good algorithms for an ellipse with 2D points, but not for an ellipsoid with 3D points. I experimented with a few different MATLAB scripts and eventually settled on Yury Petrov's Ellipsoid Fit. It fits an ellipsoid to the polynomial Ax^2 + By^2 + Cz^2 + 2Dxy + 2Exz + 2Fyz + 2Gx + 2Hy + 2Iz = 1. It doesn't use any constraints to force an ellipsoid, so you have to have a fairly large number of points to prevent a random quardic from being fit instead of the ellipsoid. Other than that, it works really well. I wrote a small Java library using Apache Commons Math that implements Yury Petrov's script in Java. The GIT repository can be found at https://github.com/BokiSoft/EllipsoidFit.

    0

提交回复
热议问题