【发布时间】:2019-09-18 11:36:25
【问题描述】:
我正在尝试求解变换矩阵 M(以其数值形式)。源点是已知的 (s1,s2,s3,s4) 目标点也是已知的 (d1,d2,d3,d4)。来自金字塔的点。 转换是任意的,并将每个点 sn 映射到其目标 dn。
显然 s1 到 s4 和 d1 到 d4 是已知的并且使用数值,为了清楚起见只是这样呈现它们
s1 = np.matrix([[s1x],[s1y],[s1z],[0]])
s2 = np.matrix([[s2x],[s2y],[s2z],[0]])
s3 = np.matrix([[s3x],[s3y],[s3z],[0]])
s4 = np.matrix([[s4x],[s4y],[s4z],[0]])
d1 = np.matrix([[d1x],[d1y],[d1z],[0]])
d2 = np.matrix([[d2x],[d2y],[d2z],[0]])
d3 = np.matrix([[d3x],[d3y],[d3z],[0]])
d4 = np.matrix([[d4x],[d4y],[d4z],[0]])
对于每个点,dn = M x sn 与:
M = np.matrix([4,4])
一般公式似乎在这里:https://en.wikipedia.org/wiki/Transformation_matrix#Finding_the_matrix_of_a_transformation
我基本上是尝试将其以代码形式呈现,如果可能的话降低复杂性以便使用 numpy linalg 求解器。
我检查了其他线程,我的问题实际上是关于一般情况的。 (最少需要 4 个点)
【问题讨论】: