假设我有 3 个点云:第一个具有 3 个点 {x1,y1,z1}、{x2,y2,z2}、{x3,y3,z3},第二个点云具有与 {xx1, yy1, zz1},{xx2,yy2,zz2},{xx3,yy3,zz3}...我假设将第二个点云与第一个点云对齐,我必须将第二个点云乘以 T[3x3matrix]。
1)那么我如何找到这个变换矩阵(T)? 我尝试手工解方程,但未能解出它们。 有没有解决方案,因为我很确定我不是第一个遇到这个问题的人。
2)我假设矩阵可能包括倾斜和剪切。 有没有办法找到只有 7 个自由度的矩阵(3 个平移,3 个旋转,1 个尺度)?
Let's say I have 3 point clouds: first that has 3 points {x1,y1,z1}, {x2,y2,z2}, {x3,y3,z3} and second point cloud that has same points as {xx1, yy1, zz1}, {xx2,yy2,zz2}, {xx3,yy3,zz3}... I assume to align second point cloud to first I have to multiply second one's points by T[3x3matrix].
1) So how do I find this transform matrix(T) ? I tried to do the equations by hand, but failed to solve them. Is there an solution somewhere, cause I'm pretty sure I'm not the first one to stumble into the problem.
2) I assume that matrix might include skewing and shearing. Is there a way to find matrix with only 7 degrees of freedom (3translation, 3rotation, 1scale)?
发布评论
评论(4)
将单位向量 {1, 0, 0}、{0, 1, 0} 和 {0, 0, 1} 转换为 {x1, y1, z1}、{x2, y2, z2} 的变换矩阵 T1, {x3, y3, z3} 很简单
同样,将这 3 个单位向量转换为第二组点的变换 T2 为
因此,将前三个点转换为后三个点的矩阵由下式给出: T2 * T1-1。 如果 T1 是非奇异的,则该变换是唯一确定的,因此它没有自由度。 如果 T1 是奇异矩阵,则可能没有解,或者可能有无穷多个解。
当你说你想要 7 个自由度时,这在某种程度上是对术语的误用。 一般情况下,该矩阵由 3 个旋转自由度、3 个缩放度和 3 个剪切度组成,总共 9 个。您可以通过执行 QR 分解。 Q 矩阵提供旋转参数,R 矩阵提供缩放参数(沿对角线)和剪切参数(对角线上方)。
The transformation matrix T1 that takes the unit vectors {1, 0, 0}, {0, 1, 0}, and {0, 0, 1} to {x1, y1, z1}, {x2, y2, z2}, {x3, y3, z3} is simply
And likewise the transformation T2 that takes those 3 unit vectors to the second set of points is
Therefore, the matrix that takes the first three points to the second three points is given by T2 * T1-1. If T1 is non-singular, then this transformation is uniquely determined, so it has no degrees of freedom. If T1 is a singular matrix, then there could be no solutions, or there could be infinitely many solutions.
When you say you want 7 degrees of freedom, this is somewhat of a misuse of terminology. In the general case, this matrix is composed of 3 rotational degrees of freedom, 3 scaling degrees, and 3 shearing degrees, making a total of 9. You can figure out these parameters by performing a QR factorization. The Q matrix gives you the rotational parameters, and the R matrix gives you the scaling parameters (along the diagonal) and the shearing parameters (above the diagonal).
亚当·罗森菲尔德的方法是正确的。 但 T2 * Inv (T1) 的解决方案是错误的。 由于在矩阵乘法中 A * B != B * A :因此结果是 Inv(T1) * T2
Approach of Adam Rosenfield is correct. But solution as T2 * Inv (T1) is wrong. Since in Matrix multiplication A * B != B * A : Hence result is Inv(T1) * T2
您所说的七参数变换是指作为 3d 共形变换,或者有时是 3d 相似变换,因为两个云是相似的。 如果两个形状相同,则 Adam Rosenfields 解决方案很好。 如果存在细微差异,并且您希望获得最佳匹配,最常用的解决方案是 Helmert 转换 它使用最小二乘法来最小化残差。 维基百科和谷歌关于这方面的内容乍一看似乎不太好。 我对此的参考是 Ghilani & Wolf 的调整计算,p345。 这也是一本关于矩阵数学应用于空间问题的好书,也是图书馆的一个很好的补充。
编辑:此变换的 Adam 9 参数版本被称为 仿射变换
The seven parameter transformation that you are talking about is referred to as a 3d conformal transformation, or sometimes a 3d similarity transformation given that the two clouds are similar. If the two shapes are identical, Adam Rosenfields solution is good. Where there are small differences, and you wish to get a best fit, the most commonly used solution is a Helmert transformation which uses a least squares approach to minimise the residuals. The wikipedia and google stuff on this doesn't seem great at a glance. My reference on this is Ghilani & Wolf's adjustment computations, p345. This is also a great book on matrix math as applied to spatial problems and a good addition to the library.
edit: Adam's 9 parameter version of this transformation is referred to as an affine transformation
这是计算 2D 参数的最小二乘估计的示例 R中的仿射变换
Here is an example of computing least-squares estimates of the parameters of a 2D affine transformation in R.