scipy.spatial.transform.Rotation的歐拉角

Rotation類跟歐拉角相關(guān)的操作有
from_euler(seq, angles, degrees=False)
as_euler(seq, degrees=False)
兩個(gè)函數(shù)。
其中,seq=('xyz')seq=('XYZ')含義不同。
scipy官方文檔定義:

Parameters:
seq:string
Specifies sequence of axes for rotations.
Up to 3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations.
Extrinsic and intrinsic rotations cannot be mixed in one function call.

即大寫字母表示內(nèi)旋,小寫字母表示外旋。

舉例說明:
相機(jī)的外參RT矩陣cam2car,表示了cam坐標(biāo)系在car坐標(biāo)系上的位置和旋轉(zhuǎn)關(guān)系。
用cam2car左乘相機(jī)坐標(biāo)系下的點(diǎn)或者向量,即可得到該點(diǎn)或向量在car坐標(biāo)系下的坐標(biāo)。
rot = Rotation.from_matrix(cam2car[:3,:3])
intrinsic_rot = rot.as_euler('XYZ', degrees=True)
extrinsic_rot = rot.as_euler('xyz', degrees=True)
以前視和左前兩個(gè)相機(jī)的外參為例,
通過上述計(jì)算得到:
前視相機(jī)的intrinsic_rot = (0,90,-90), extrinsic_rot = (-90,0,-90)
左前相機(jī)的intrinsic_rot = (-90,32,0), extrinsic_rot = (-90,0,-32)

IMG_20240201_113147.jpg

旋轉(zhuǎn)過程如上圖所示,由car坐標(biāo)系出發(fā),經(jīng)過以上歐拉角的旋轉(zhuǎn),獲得camera坐標(biāo)系。
結(jié)果符合預(yù)期。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容