rotationMatrixToVector
(非推奨) 3 次元回転行列から回転ベクトルへの変換
rotationMatrixToVector
は推奨されません。代わりに関数 rotmat2vec3d
を使用してください。詳細については、互換性の考慮事項を参照してください。
説明
は入力 3 次元回転行列に対応する軸角度の回転ベクトルを返します。この関数は変換にロドリゲスの公式を使用します。rotationVector
= rotationMatrixToVector(rotationMatrix
)
例
回転行列から回転ベクトルへの変換
Z 軸周りの 90 度の回転を表す行列を作成します。
rotationMatrix = [0 1 0; -1 0 0; 0 0 1];
等価な回転ベクトルを求めます。
rotationVector = rotationMatrixToVector(rotationMatrix)
rotationVector = 1×3
0 0 1.5708
入力引数
rotationMatrix
— カメラの回転
3 行 3 列の行列
カメラの回転。3 行 3 列の行列として指定します。この行列は、関数 estimateExtrinsics
を使用して取得できます。
出力引数
rotationVector
— 回転ベクトル
3 要素ベクトル
回転ベクトル。3 要素ベクトルとして返されます。ベクトルは、3 次元空間での回転軸を表します。大きさはラジアン単位の回転角度に対応します。
データ型: single
| double
参照
[1] Trucco, Emanuele, and Alessandro Verri. Introductory Techniques for 3-D Computer Vision. Upper Saddle River, NJ: Prentice Hall, 1998.
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
バージョン履歴
R2016a で導入R2022b: 非推奨
R2022b 以降、Computer Vision Toolbox™ のほとんどの関数は、左から乗算する規則を使用して幾何学的変換を作成および実行します。ただし、関数 rotationMatrixToVector
は、右から乗算する規則を使用します。現時点で rotationMatrixToVector
を削除する予定はありませんが、左から乗算する規則をサポートする関数 rotmat2vec3d
に切り替えることで、幾何学的変換ワークフローを効率化できます。詳細については、Migrate Geometric Transformations to Premultiply Conventionを参照してください。
コードを更新するには、次を行います。
関数名
rotationMatrixToVector
のインスタンスをrotmat2vec3d
に変更します。回転行列を、関数
rotationMatrixToVector
の引数rotationMatrix
の転置として指定します。または、関数estimateExtrinsics
を使用し、返されたrigidtform3d
オブジェクトのR
プロパティをクエリすることにより、左から乗算する正しい形式で回転行列を取得できます。
次の表は、コードを更新する方法の例を示しています。
非推奨の使用方法 | 推奨される代替案 |
---|---|
この例では、関数 rotVectorOld = rotationMatrixToVector(rotMatrixOld) | この例では、関数 rotMatrixNew = rotMatrixOld'; rotVectorNew = rotmat2vec2d(rotMatrixNew); |
この例では、関数 [rotMatrixOld,transVector] = extrinsics( ...
imagePoints,worldPoints,intrinsics);
rotVectorOld = rotationMatrixToVector(rotMatrixOld); | この例では、関数 camExtrinsics = estimateExtrinsics( ...
imagePoints,worldPoints,intrinsics);
rotMatrixNew = camExtrinsics.R;
rotVectorNew = rotmat2vec2d(rotMatrixNew); |
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)