OpenCV 5.0.0
Open Source Computer Vision
読み込み中...
検索中...
見つかりません
🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
cv::Affine3< T > クラステンプレート

アフィン変換。 詳細...

#include <opencv2/core/affine.hpp>

Collaboration diagram for cv::Affine3< T >:

公開型

typedef T float_type
 
typedef Matx< float_type, 3, 3 > Mat3
 
typedef Matx< float_type, 4, 4 > Mat4
 
typedef Vec< float_type, 3 > Vec3
 

公開メンバ関数

 Affine3 ()
 デフォルトコンストラクタ。4x4の単位行列を表す。
 
 Affine3 (const float_type *vals)
 16要素の配列から。
 
 Affine3 (const Mat &data, const Vec3 &t=Vec3::all(0))
 
 Affine3 (const Mat3 &R, const Vec3 &t=Vec3::all(0))
 
 Affine3 (const Mat4 &affine)
 拡張アフィン行列。
 
 Affine3 (const Vec3 &rvec, const Vec3 &t=Vec3::all(0))
 
template<typename Y >
Affine3< Y > cast () const
 
Affine3 concatenate (const Affine3 &affine) const
 a.concatenate(affine) は affine * a と等価である。
 
Affine3 inv (int method=cv::DECOMP_SVD) const
 
Mat3 linear () const
 
void linear (const Mat3 &L)
 
template<typename Y >
 operator Affine3< Y > () const
 
Affine3 rotate (const Mat3 &R) const
 a.rotate(R) は Affine(R, 0) * a と等価である。
 
Affine3 rotate (const Vec3 &rvec) const
 a.rotate(rvec) は Affine(rvec, 0) * a と等価である。
 
Mat3 rotation () const
 
void rotation (const Mat &data)
 
void rotation (const Mat3 &R)
 
void rotation (const Vec3 &rvec)
 
Vec3 rvec () const
 
Affine3 translate (const Vec3 &t) const
 a.translate(t) は Affine(E, t) * a と等価である。ここでEは単位行列である。
 
Vec3 translation () const
 
void translation (const Vec3 &t)
 

静的公開メンバ関数

static Affine3 Identity ()
 4x4の単位変換を作成する。
 

公開変数類

Mat4 matrix
 

詳細説明

template<typename T>
class cv::Affine3< T >

アフィン変換。

4x4の同次変換行列 \(T\) を表す

\[T = \begin{bmatrix} R & t\\ 0 & 1\\ \end{bmatrix} \]

ここで \(R\) は3x3の回転行列、\(t\) は3x1の並進ベクトルである。

\(R\) は3x3の回転行列、または3x1の回転ベクトルのいずれかで指定できる。回転ベクトルはロドリゲスの公式によって3x3の回転行列に変換される。

まず軸 \(r\) まわりに回転角 \(|r|\) ラジアン(右手の法則)で回転し、次にベクトル \(t\) で並進する変換を表す行列 \(T\) を構築するには、次を使用できる

既に回転行列 \(R\) を持っている場合は、次を使用できる

\(T\) から回転行列 \(R\) を取り出すには、次を使用する

cv::Matx33f R = T.rotation();

\(T\) から並進ベクトル \(t\) を取り出すには、次を使用する

cv::Vec3f t = T.translation();

\(T\) から回転ベクトル \(r\) を取り出すには、次を使用する

cv::Vec3f r = T.rvec();

回転ベクトルから回転行列への写像は多対一であることに注意せよ。返される回転ベクトルは、行列を設定する際に使用したものと必ずしも一致しない。

2つの変換 \(T = T_1 * T_2\) がある場合は、次を使用する

cv::Affine3f T, T1, T2;
T = T2.concatenate(T1);
Affine3 concatenate(const Affine3 &affine) const
a.concatenate(affine) is equivalent to affine * a;

\(T\) の逆変換を得るには、次を使用する

cv::Affine3f T, T_inv;
T_inv = T.inv();
Affine3 inv(int method=cv::DECOMP_SVD) const

型定義メンバ詳解

◆ float_type

template<typename T >
T cv::Affine3< T >::float_type

◆ Mat3

template<typename T >
Matx<float_type, 3, 3> cv::Affine3< T >::Mat3

◆ Mat4

template<typename T >
Matx<float_type, 4, 4> cv::Affine3< T >::Mat4

◆ Vec3

template<typename T >
Vec<float_type, 3> cv::Affine3< T >::Vec3

構築子と解体子の詳解

◆ Affine3() [1/6]

template<typename T >
cv::Affine3< T >::Affine3 ( )

デフォルトコンストラクタ。4x4の単位行列を表す。

◆ Affine3() [2/6]

template<typename T >
cv::Affine3< T >::Affine3 ( const Mat4 & affine)

拡張アフィン行列。

◆ Affine3() [3/6]

template<typename T >
cv::Affine3< T >::Affine3 ( const Mat3 & R,
const Vec3 & t = Vec3::all(0) )

結果として得られる4x4行列は次のとおり

\[ \begin{bmatrix} R & t\\ 0 & 1\\ \end{bmatrix} \]

引数
R3x3の回転行列。
t3x1の並進ベクトル。

◆ Affine3() [4/6]

template<typename T >
cv::Affine3< T >::Affine3 ( const Vec3 & rvec,
const Vec3 & t = Vec3::all(0) )

ロドリゲスベクトル。

現在の行列の最終行は [0,0,0,1] に設定される。

引数
rvec3x1の回転ベクトル。その方向は回転軸を示し、その長さは回転角度をラジアンで示す(右手の法則を使用)。
t3x1の並進ベクトル。

◆ Affine3() [5/6]

template<typename T >
cv::Affine3< T >::Affine3 ( const Mat & data,
const Vec3 & t = Vec3::all(0) )
explicit

上記のすべてのコンストラクタを統合する。dataの行列サイズとして4x4, 3x4, 3x3, 1x3, 3x1をサポートする。

dataが4x4でない場合、現在の行列の最終行は [0,0,0,1] に設定される。

引数
dataシングルチャンネル行列。4x4の場合、現在の行列にコピーされ、tは使用されない。3x4の場合、現在の行列の上部3x4にコピーされ、tは使用されない。3x3の場合、現在の行列の左上3x3部分にコピーされる。3x1または1x3の場合、回転ベクトルとして扱われ、ロドリゲスの公式を用いて3x3の回転行列が計算される。
t3x1の並進ベクトル。dataが4x4でも3x4でもない場合にのみ使用される。

◆ Affine3() [6/6]

template<typename T >
cv::Affine3< T >::Affine3 ( const float_type * vals)
explicit

16要素の配列から。

メンバ関数詳解

◆ cast()

template<typename T >
template<typename Y >
Affine3< Y > cv::Affine3< T >::cast ( ) const

◆ concatenate()

template<typename T >
Affine3 cv::Affine3< T >::concatenate ( const Affine3< T > & affine) const

a.concatenate(affine) は affine * a と等価である。

◆ Identity()

template<typename T >
static Affine3 cv::Affine3< T >::Identity ( )
static

4x4の単位変換を作成する。

◆ inv()

template<typename T >
Affine3 cv::Affine3< T >::inv ( int method = cv::DECOMP_SVD) const
戻り値
現在の行列の逆行列。

◆ linear() [1/2]

template<typename T >
Mat3 cv::Affine3< T >::linear ( ) const
戻り値
左上の3x3部分

◆ linear() [2/2]

template<typename T >
void cv::Affine3< T >::linear ( const Mat3 & L)

3x3行列Lを現在の行列の左上部分にコピーする

行列の左上3x3部分を設定する。残りの部分は影響を受けない。

引数
L3x3の行列。

◆ operator Affine3< Y >()

template<typename T >
template<typename Y >
cv::Affine3< T >::operator Affine3< Y > ( ) const

◆ rotate() [1/2]

template<typename T >
Affine3 cv::Affine3< T >::rotate ( const Mat3 & R) const

a.rotate(R) は Affine(R, 0) * a と等価である。

◆ rotate() [2/2]

template<typename T >
Affine3 cv::Affine3< T >::rotate ( const Vec3 & rvec) const

a.rotate(rvec) は Affine(rvec, 0) * a と等価である。

◆ rotation() [1/4]

template<typename T >
Mat3 cv::Affine3< T >::rotation ( ) const
戻り値
左上の3x3部分

◆ rotation() [2/4]

template<typename T >
void cv::Affine3< T >::rotation ( const Mat & data)

上記の回転メソッドを統合する。dataの行列サイズとして3x3, 1x3, 3x1をサポートする。

行列の左上3x3部分を設定する。残りの部分は影響を受けない。

引数
dataシングルチャンネル行列。3x3行列の場合、現在の行列の左上3x3部分を設定する。1x3または3x1行列の場合、回転ベクトルとして使用される。ロドリゲスの公式を用いて回転行列が計算され、現在の行列の左上3x3部分を設定する。

◆ rotation() [3/4]

template<typename T >
void cv::Affine3< T >::rotation ( const Mat3 & R)

回転行列。

回転行列を現在の行列の左上3x3部分にコピーする。現在の行列の残りの要素は変更されない。

引数
R3x3の回転行列。

◆ rotation() [4/4]

template<typename T >
void cv::Affine3< T >::rotation ( const Vec3 & rvec)

ロドリゲスベクトル。

行列の左上3x3部分を設定する。残りの部分は影響を受けない。

引数
rvec3x1の回転ベクトル。その方向は回転軸を示し、その長さは回転角度をラジアンで示す(右手親指の規約を使用)。

◆ rvec()

template<typename T >
Vec3 cv::Affine3< T >::rvec ( ) const

ロドリゲスベクトル。

戻り値
現在の行列の左上3x3回転行列を表すベクトル。
警告
回転ベクトルと回転行列の対応は多対一であるため、この関数は現在の回転行列を表す回転ベクトルを1つだけ返す。これは rotation(const Vec3& rvec) で設定したものと必ずしも同じではない。

◆ translate()

template<typename T >
Affine3 cv::Affine3< T >::translate ( const Vec3 & t) const

a.translate(t) は Affine(E, t) * a と等価である。ここでEは単位行列である。

◆ translation() [1/2]

template<typename T >
Vec3 cv::Affine3< T >::translation ( ) const
戻り値
右上の3x1部分

◆ translation() [2/2]

template<typename T >
void cv::Affine3< T >::translation ( const Vec3 & t)

tを現在の行列の最終列の最初の3要素にコピーする

行列の右上3x1部分を設定する。残りの部分は影響を受けない。

引数
t3x1の並進ベクトル。

メンバ変数詳解

◆ matrix

template<typename T >
Mat4 cv::Affine3< T >::matrix

このクラス詳解は次のファイルから抽出されました: