通过减少正交距离最佳拟合平面正交、平面、距离

2023-09-11 04:56:55 作者:曲终人散欺骗

我有一组点(在表格的 X1,Y1,Z1 ... XN,YN,锌的)从表面网格获得。我想通过最小化正交距离来找到最佳拟合三维平面至这些点。 X,Y,Z 的坐标是独立的,这是我想要得到的系数A,B,C,D为平面方程ax +到+锆+ D = 0。

I have a set of points (in the form x1,y1,z1 ... xn,yn,zn) obtained from a surface mesh. I want to find the best-fit 3D plane to these points by minimizing orthogonal distances. x,y,z coordinates are independent, that is I want to obtain the coefficient A, B, C, D for the plane equation Ax + By + Cz + D = 0.

什么是算法来获得A,B,C,D?

What would be the algorithm to obtain A, B, C, D?

注:在 previous帖子这是讨论的最佳拟合平面在最小二乘意义上说,通过考虑的以Z 的协调线性的 X,Y功能的。然而,这不是我的情况。

Note: in a previous post it was discussed the best-fit plane in a least squares sense, by considering the z coordinate a linear function of x,y. However this is not my case.

推荐答案

从记忆中,这变成一个特征向量的问题。从点到你的飞机之间的距离成正比,斧+到+锆+ D - 一种方式看,这是需要注意的是一个垂直于平面(A,B,C)。该常数D是颈部疼痛,但我认为你可以重新定义你的变量将它转移到一个常数,使得一切都意味着0。在这种情况下,我认为最合适平面将穿过原点摆脱它

From memory, this turns into an eigenvector problem. The distance from a point to your plane is proportional to Ax + By + Cz + D - one way to see this is to note that a normal to the plane is (A, B, C). The constant D is a pain in the neck, but I think you can get rid of it by redefining your variables to shift it to a constant so that everything has mean 0. In this case I think the best fitting plane will go through the origin.

您然后找到要最大限度地减少SUM_i(X_i A)^ 2,其中A为3载体。当然你也可以让这个任意小的由一些小的标量乘以A的所有组件,因此要尽量减少这种受该如约束||一|| ^ 2 = 1,这使得比例由制作单位向量的感觉。 (X_i A)^ 2 = A'(X_i'X)A,所以要尽量减少 A'(SUM_i(X_i'X_i))。那么我想你想SUM_i X_i'X_i的最小特征向量

You then find you want to minimise SUM_i (X_i . A)^2 where A is a 3-vector. Of course you can make this arbitrarily small by multiplying all components of A by some small scalar, so you want to minimise this subject to the constraint that e.g. ||A||^2 = 1, which makes sense of the proportionality by making A a unit vector. (X_i . A)^2 = A' (X_i' X) A, so you want to minimise A' (SUM_i (X_i'X_i)) A So I think you want the minimum eigenvector of SUM_i X_i'X_i

这是不更频繁地使用在统计原因之一是,回答您得到如果缩放的任何的坐标向量的单元不类似地通过相同的量缩放的单位在其他方向将改变。

One reason this isn't used more frequently in statistics is that the answer you get will change if you scale the units of any of the co-ordinate vectors without similarly scaling the units in other directions by the same amount.

试想想起来了,你可以看到这一切摸索出正确的http://en.wikipedia.org/wiki/Total_least_squares

Come to think of it, you can see all this worked out properly at http://en.wikipedia.org/wiki/Total_least_squares