【问题标题】:find the angle of transformation through perspective transform matrix通过透视变换矩阵求变换角度
【发布时间】:2020-06-01 03:33:23
【问题描述】:

应用透视变换函数后我得到了一个 3*3 矩阵,我想通过变换矩阵找出旋转角度。 我得到了这个 3*3 矩阵:

[[ 3.89007777e+00 -9.00480966e-02 -9.29332376e+02]
 [-3.47394211e-01  3.27758886e+00 -3.55127508e+02]
 [ 1.33714080e-03 -4.37819257e-04  1.00000000e+00]]

建议我一条路径,通过它我可以找到所有三个方向的角度。

【问题讨论】:

标签: python opencv computer-vision artificial-intelligence data-science


【解决方案1】:

如果您有名为 rqmtx 的矩阵:

phi = math.atan2(rqmtx[2][1], rqmtx[2][2])
psi = math.atan2(rqmtx[1][0], rqmtx[0][0])

if math.cos(psi) == 0:
    thetaa = math.atan2(-rqmtx[2][0], (rqmtx[1][0]/math.sin(psi)))
else:
    thetaa = math.atan2(-rqmtx[2][0], (rqmtx[0][0]/math.cos(psi)))
    
s = math.atan2(rqmtx[0][0], -math.sqrt(rqmtx[2][1]*rqmtx[2][1] + rqmtx[2][2]*rqmtx[2][2]))

pi = 22/7

phid = phi*(180/pi)
thetaad = thetaa*(180/pi)
psid = psi*(180/pi)

【讨论】:

    猜你喜欢
    • 2011-03-09
    • 2014-04-06
    • 1970-01-01
    • 2012-11-27
    • 1970-01-01
    • 2020-08-11
    • 2013-10-27
    • 2016-06-09
    • 1970-01-01
    相关资源
    最近更新 更多