🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。

クラス Calib3d


  • public class Calib3d
    extends java.lang.Object
    • コンストラクタの詳細

      • Calib3d

        public Calib3d()
    • メソッドの詳細

      • Rodrigues

        public static void Rodrigues​(Mat src,
                                     Mat dst,
                                     Mat jacobian)
        Converts a rotation matrix to a rotation vector or vice versa.
        引数:
        src - 入力の回転ベクトル (3x1 または 1x3) もしくは回転行列 (3x3)。
        dst - 出力の回転行列 (3x3) もしくは回転ベクトル (3x1 または 1x3)。入力に応じてそれぞれ対応する。
        jacobian - Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial derivatives of the output array components with respect to the input array components. \(\begin{array}{l} \theta \leftarrow norm(r) \\ r \leftarrow r/ \theta \\ R = \cos(\theta) I + (1- \cos{\theta} ) r r^T + \sin(\theta) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \end{array}\) Inverse transformation can be also done easily, since \(\sin ( \theta ) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \frac{R - R^T}{2}\) A rotation vector is a convenient and most compact representation of a rotation matrix (since any rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry optimization procedures like REF: calibrateCamera, REF: stereoCalibrate, or REF: solvePnP . 覚え書き: More information about the computation of the derivative of a 3D rotation matrix with respect to its exponential coordinate can be found in:
        • A Compact Formula for the Derivative of a 3-D Rotation in Exponential Coordinates, Guillermo Gallego, Anthony J. Yezzi CITE: Gallego2014ACF
        覚え書き: Useful information on SE(3) and Lie Groups can be found in:
        • A tutorial on SE(3) transformation parameterizations and on-manifold optimization, Jose-Luis Blanco CITE: blanco2010tutorial
        • Lie Groups for 2D and 3D Transformation, Ethan Eade CITE: Eade17
        • A micro Lie theory for state estimation in robotics, Joan Solà, Jérémie Deray, Dinesh Atchuthan CITE: Sol2018AML
      • Rodrigues

        public static void Rodrigues​(Mat src,
                                     Mat dst)
        Converts a rotation matrix to a rotation vector or vice versa.
        引数:
        src - 入力の回転ベクトル (3x1 または 1x3) もしくは回転行列 (3x3)。
        dst - Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively. derivatives of the output array components with respect to the input array components. \(\begin{array}{l} \theta \leftarrow norm(r) \\ r \leftarrow r/ \theta \\ R = \cos(\theta) I + (1- \cos{\theta} ) r r^T + \sin(\theta) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \end{array}\) Inverse transformation can be also done easily, since \(\sin ( \theta ) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \frac{R - R^T}{2}\) A rotation vector is a convenient and most compact representation of a rotation matrix (since any rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry optimization procedures like REF: calibrateCamera, REF: stereoCalibrate, or REF: solvePnP . 覚え書き: More information about the computation of the derivative of a 3D rotation matrix with respect to its exponential coordinate can be found in:
        • A Compact Formula for the Derivative of a 3-D Rotation in Exponential Coordinates, Guillermo Gallego, Anthony J. Yezzi CITE: Gallego2014ACF
        覚え書き: Useful information on SE(3) and Lie Groups can be found in:
        • A tutorial on SE(3) transformation parameterizations and on-manifold optimization, Jose-Luis Blanco CITE: blanco2010tutorial
        • Lie Groups for 2D and 3D Transformation, Ethan Eade CITE: Eade17
        • A micro Lie theory for state estimation in robotics, Joan Solà, Jérémie Deray, Dinesh Atchuthan CITE: Sol2018AML
      • findHomography

        public static Mat findHomography​(MatOfPoint2f srcPoints,
                                         MatOfPoint2f dstPoints,
                                         int method,
                                         double ransacReprojThreshold,
                                         Mat mask,
                                         int maxIters,
                                         double confidence)
        Finds a perspective transformation between two planes.
        引数:
        srcPoints - 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        dstPoints - 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        method - Method used to compute a homography matrix. The following methods are possible:
        • 0 - すべての点を使用する通常の手法、すなわち最小二乗法
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
        • REF: RHO - PROSACベースのロバスト推定法
        ransacReprojThreshold - 点ペアをインライアとして扱うために許容される最大の再投影誤差 (RANSAC法およびRHO法でのみ使用される)。すなわち、\(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) であれば、点 \(i\) はアウトライアとみなされる。srcPoints と dstPoints をピクセル単位で計測している場合、通常はこのパラメータを 1 から 10 の範囲のどこかに設定するのが妥当である。
        mask - ロバスト推定法 ( RANSAC または LMeDS ) によって設定される省略可能な出力マスク。入力マスクの値は無視される点に注意。
        maxIters - RANSACの最大反復回数。
        confidence - 信頼度。0 から 1 の間の値。この関数は、ソース平面とデスティネーション平面の間の透視変換 \(H\) を求めて返す: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) のように、逆投影誤差 \(\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\) を最小化する。パラメータ method がデフォルト値 0 に設定されている場合、関数は単純な最小二乗法によって初期ホモグラフィ推定値を計算するためにすべての点ペアを使用する。しかし、すべての点ペア ( \(srcPoints_i\), \(dstPoints_i\) ) が剛体の透視変換に適合しない (すなわちいくつかのアウトライアが存在する) 場合、この初期推定値は不正確になる。この場合、3 つのロバスト推定法のいずれかを使用できる。RANSAC、LMeDS、RHO の各手法は、対応する点ペアの多数の異なるランダムなサブセット (各 4 ペアずつで、共線なペアは破棄される) を試し、このサブセットと単純な最小二乗アルゴリズムを用いてホモグラフィ行列を推定し、計算されたホモグラフィの品質/良さ (RANSAC ではインライアの数、LMeDS では再投影誤差の最小メディアン) を計算する。次に、最良のサブセットを用いてホモグラフィ行列の初期推定値とインライア/アウトライアのマスクを生成する。手法がロバストであるか否かにかかわらず、計算されたホモグラフィ行列は、再投影誤差をさらに低減するために Levenberg-Marquardt 法を用いて (ロバスト推定法の場合はインライアのみを使用して) さらに洗練される。RANSAC 法と RHO 法は実質的に任意の比率のアウトライアを扱えるが、インライアとアウトライアを区別するためのしきい値を必要とする。LMeDS 法はしきい値を必要としないが、インライアが 50% を超える場合にのみ正しく機能する。最後に、アウトライアが存在せずノイズがかなり小さい場合は、デフォルトの手法 (method=0) を使用する。この関数は、初期の内部行列および外部行列を求めるために使用される。ホモグラフィ行列はスケールを除いて決定される。\(h_{33}\) が非ゼロの場合、行列は \(h_{33}=1\) となるように正規化される。覚え書き: \(H\) 行列を推定できない場合は、常に空の行列が返される。SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform
        戻り値:
        自動生成
      • findHomography

        public static Mat findHomography​(MatOfPoint2f srcPoints,
                                         MatOfPoint2f dstPoints,
                                         int method,
                                         double ransacReprojThreshold,
                                         Mat mask,
                                         int maxIters)
        Finds a perspective transformation between two planes.
        引数:
        srcPoints - 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        dstPoints - 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        method - Method used to compute a homography matrix. The following methods are possible:
        • 0 - すべての点を使用する通常の手法、すなわち最小二乗法
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
        • REF: RHO - PROSACベースのロバスト推定法
        ransacReprojThreshold - 点ペアをインライアとして扱うために許容される最大の再投影誤差 (RANSAC法およびRHO法でのみ使用される)。すなわち、\(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) であれば、点 \(i\) はアウトライアとみなされる。srcPoints と dstPoints をピクセル単位で計測している場合、通常はこのパラメータを 1 から 10 の範囲のどこかに設定するのが妥当である。
        mask - ロバスト推定法 ( RANSAC または LMeDS ) によって設定される省略可能な出力マスク。入力マスクの値は無視される点に注意。
        maxIters - RANSACの最大反復回数。この関数は、ソース平面とデスティネーション平面の間の透視変換 \(H\) を求めて返す: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) のように、逆投影誤差 \(\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\) を最小化する。パラメータ method がデフォルト値 0 に設定されている場合、関数は単純な最小二乗法によって初期ホモグラフィ推定値を計算するためにすべての点ペアを使用する。しかし、すべての点ペア ( \(srcPoints_i\), \(dstPoints_i\) ) が剛体の透視変換に適合しない (すなわちいくつかのアウトライアが存在する) 場合、この初期推定値は不正確になる。この場合、3 つのロバスト推定法のいずれかを使用できる。RANSAC、LMeDS、RHO の各手法は、対応する点ペアの多数の異なるランダムなサブセット (各 4 ペアずつで、共線なペアは破棄される) を試し、このサブセットと単純な最小二乗アルゴリズムを用いてホモグラフィ行列を推定し、計算されたホモグラフィの品質/良さ (RANSAC ではインライアの数、LMeDS では再投影誤差の最小メディアン) を計算する。次に、最良のサブセットを用いてホモグラフィ行列の初期推定値とインライア/アウトライアのマスクを生成する。手法がロバストであるか否かにかかわらず、計算されたホモグラフィ行列は、再投影誤差をさらに低減するために Levenberg-Marquardt 法を用いて (ロバスト推定法の場合はインライアのみを使用して) さらに洗練される。RANSAC 法と RHO 法は実質的に任意の比率のアウトライアを扱えるが、インライアとアウトライアを区別するためのしきい値を必要とする。LMeDS 法はしきい値を必要としないが、インライアが 50% を超える場合にのみ正しく機能する。最後に、アウトライアが存在せずノイズがかなり小さい場合は、デフォルトの手法 (method=0) を使用する。この関数は、初期の内部行列および外部行列を求めるために使用される。ホモグラフィ行列はスケールを除いて決定される。\(h_{33}\) が非ゼロの場合、行列は \(h_{33}=1\) となるように正規化される。覚え書き: \(H\) 行列を推定できない場合は、常に空の行列が返される。SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform
        戻り値:
        自動生成
      • findHomography

        public static Mat findHomography​(MatOfPoint2f srcPoints,
                                         MatOfPoint2f dstPoints,
                                         int method,
                                         double ransacReprojThreshold,
                                         Mat mask)
        Finds a perspective transformation between two planes.
        引数:
        srcPoints - 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        dstPoints - 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        method - Method used to compute a homography matrix. The following methods are possible:
        • 0 - すべての点を使用する通常の手法、すなわち最小二乗法
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
        • REF: RHO - PROSACベースのロバスト推定法
        ransacReprojThreshold - 点ペアをインライアとして扱うために許容される最大の再投影誤差 (RANSAC法およびRHO法でのみ使用される)。すなわち、\(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) であれば、点 \(i\) はアウトライアとみなされる。srcPoints と dstPoints をピクセル単位で計測している場合、通常はこのパラメータを 1 から 10 の範囲のどこかに設定するのが妥当である。
        mask - ロバスト推定法 ( RANSAC または LMeDS ) によって設定される省略可能な出力マスク。入力マスクの値は無視される点に注意。この関数は、ソース平面とデスティネーション平面の間の透視変換 \(H\) を求めて返す: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) のように、逆投影誤差 \(\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\) を最小化する。パラメータ method がデフォルト値 0 に設定されている場合、関数は単純な最小二乗法によって初期ホモグラフィ推定値を計算するためにすべての点ペアを使用する。しかし、すべての点ペア ( \(srcPoints_i\), \(dstPoints_i\) ) が剛体の透視変換に適合しない (すなわちいくつかのアウトライアが存在する) 場合、この初期推定値は不正確になる。この場合、3 つのロバスト推定法のいずれかを使用できる。RANSAC、LMeDS、RHO の各手法は、対応する点ペアの多数の異なるランダムなサブセット (各 4 ペアずつで、共線なペアは破棄される) を試し、このサブセットと単純な最小二乗アルゴリズムを用いてホモグラフィ行列を推定し、計算されたホモグラフィの品質/良さ (RANSAC ではインライアの数、LMeDS では再投影誤差の最小メディアン) を計算する。次に、最良のサブセットを用いてホモグラフィ行列の初期推定値とインライア/アウトライアのマスクを生成する。手法がロバストであるか否かにかかわらず、計算されたホモグラフィ行列は、再投影誤差をさらに低減するために Levenberg-Marquardt 法を用いて (ロバスト推定法の場合はインライアのみを使用して) さらに洗練される。RANSAC 法と RHO 法は実質的に任意の比率のアウトライアを扱えるが、インライアとアウトライアを区別するためのしきい値を必要とする。LMeDS 法はしきい値を必要としないが、インライアが 50% を超える場合にのみ正しく機能する。最後に、アウトライアが存在せずノイズがかなり小さい場合は、デフォルトの手法 (method=0) を使用する。この関数は、初期の内部行列および外部行列を求めるために使用される。ホモグラフィ行列はスケールを除いて決定される。\(h_{33}\) が非ゼロの場合、行列は \(h_{33}=1\) となるように正規化される。覚え書き: \(H\) 行列を推定できない場合は、常に空の行列が返される。SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform
        戻り値:
        自動生成
      • findHomography

        public static Mat findHomography​(MatOfPoint2f srcPoints,
                                         MatOfPoint2f dstPoints,
                                         int method,
                                         double ransacReprojThreshold)
        Finds a perspective transformation between two planes.
        引数:
        srcPoints - 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        dstPoints - 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        method - Method used to compute a homography matrix. The following methods are possible:
        • 0 - すべての点を使用する通常の手法、すなわち最小二乗法
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
        • REF: RHO - PROSACベースのロバスト推定法
        ransacReprojThreshold - 点のペアをインライアとして扱うために許容される再投影誤差の最大値(RANSAC法とRHO法でのみ使用される)。すなわち、\(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) であれば、点 \(i\) はアウトライアとみなされる。srcPoints と dstPoints がピクセル単位で計測されている場合、この引数は通常 1 から 10 の範囲に設定するのが妥当である。mask の値は無視される。この関数は、ソース平面とデスティネーション平面の間の透視変換 \(H\) を求めて返す: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) これは、逆投影誤差 \(\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\) を最小化するように行われる。引数 method がデフォルト値の 0 に設定されている場合、この関数はすべての点のペアを用いて、単純な最小二乗法によりホモグラフィの初期推定値を計算する。ただし、すべての点のペア( \(srcPoints_i\), \(dstPoints_i\) )が剛体的な透視変換に適合しない場合(すなわち、いくつかのアウトライアが存在する場合)、この初期推定値は不正確になる。この場合、3つのロバストな手法のいずれかを使用できる。RANSAC、LMeDS、RHO の各手法は、対応する点のペアのさまざまなランダムな部分集合(それぞれ4組ずつで、共線なペアは除外される)を多数試行し、その部分集合と単純な最小二乗アルゴリズムを用いてホモグラフィ行列を推定し、計算されたホモグラフィの品質・良さ(RANSAC の場合はインライアの数、LMeDS の場合は再投影誤差の最小中央値)を計算する。次に、最良の部分集合を用いてホモグラフィ行列の初期推定値とインライア/アウトライアのマスクを生成する。ロバストか否かを問わず、計算されたホモグラフィ行列は、再投影誤差をさらに低減するために Levenberg-Marquardt 法により(ロバストな手法の場合はインライアのみを用いて)さらに精緻化される。RANSAC 法と RHO 法は実質的に任意の比率のアウトライアを扱えるが、インライアとアウトライアを区別するためのしきい値を必要とする。LMeDS 法はしきい値を必要としないが、インライアが 50% を超える場合にのみ正しく動作する。最後に、アウトライアが存在せずノイズが比較的小さい場合は、デフォルトの手法(method=0)を使用する。この関数は内部・外部パラメータ行列の初期値を求めるために使用される。ホモグラフィ行列はスケール倍の不定性をもって決定される。\(h_{33}\) が非ゼロの場合、\(h_{33}=1\) となるように行列が正規化される。覚え書き: \(H\) 行列を推定できない場合は、常に空の行列が返される。SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform
        戻り値:
        自動生成
      • findHomography

        public static Mat findHomography​(MatOfPoint2f srcPoints,
                                         MatOfPoint2f dstPoints,
                                         int method)
        Finds a perspective transformation between two planes.
        引数:
        srcPoints - 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        dstPoints - 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        method - Method used to compute a homography matrix. The following methods are possible:
        • 0 - すべての点を使用する通常の手法、すなわち最小二乗法
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
        • REF: RHO - PROSACベースのロバスト推定法
        (used in the RANSAC and RHO methods only). That is, if \(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) then the point \(i\) is considered as an outlier. If srcPoints and dstPoints are measured in pixels, it usually makes sense to set this parameter somewhere in the range of 1 to 10. mask values are ignored. The function finds and returns the perspective transformation \(H\) between the source and the destination planes: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) so that the back-projection error \(\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\) is minimized. If the parameter method is set to the default value 0, the function uses all the point pairs to compute an initial homography estimate with a simple least-squares scheme. However, if not all of the point pairs ( \(srcPoints_i\), \(dstPoints_i\) ) fit the rigid perspective transformation (that is, there are some outliers), this initial estimate will be poor. In this case, you can use one of the three robust methods. The methods RANSAC, LMeDS and RHO try many different random subsets of the corresponding point pairs (of four pairs each, collinear pairs are discarded), estimate the homography matrix using this subset and a simple least-squares algorithm, and then compute the quality/goodness of the computed homography (which is the number of inliers for RANSAC or the least median re-projection error for LMeDS). The best subset is then used to produce the initial estimate of the homography matrix and the mask of inliers/outliers. Regardless of the method, robust or not, the computed homography matrix is refined further (using inliers only in case of a robust method) with the Levenberg-Marquardt method to reduce the re-projection error even more. The methods RANSAC and RHO can handle practically any ratio of outliers but need a threshold to distinguish inliers from outliers. The method LMeDS does not need any threshold but it works correctly only when there are more than 50% of inliers. Finally, if there are no outliers and the noise is rather small, use the default method (method=0). The function is used to find initial intrinsic and extrinsic matrices. Homography matrix is determined up to a scale. If \(h_{33}\) is non-zero, the matrix is normalized so that \(h_{33}=1\). 覚え書き: Whenever an \(H\) matrix cannot be estimated, an empty one will be returned. SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform
        戻り値:
        自動生成
      • findHomography

        public static Mat findHomography​(MatOfPoint2f srcPoints,
                                         MatOfPoint2f dstPoints)
        Finds a perspective transformation between two planes.
        引数:
        srcPoints - 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。
        dstPoints - Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or a vector<Point2f> .
        • 0 - すべての点を使用する通常の手法、すなわち最小二乗法
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
        • REF: RHO - PROSACベースのロバスト推定法
        (used in the RANSAC and RHO methods only). That is, if \(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) then the point \(i\) is considered as an outlier. If srcPoints and dstPoints are measured in pixels, it usually makes sense to set this parameter somewhere in the range of 1 to 10. mask values are ignored. The function finds and returns the perspective transformation \(H\) between the source and the destination planes: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) so that the back-projection error \(\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\) is minimized. If the parameter method is set to the default value 0, the function uses all the point pairs to compute an initial homography estimate with a simple least-squares scheme. However, if not all of the point pairs ( \(srcPoints_i\), \(dstPoints_i\) ) fit the rigid perspective transformation (that is, there are some outliers), this initial estimate will be poor. In this case, you can use one of the three robust methods. The methods RANSAC, LMeDS and RHO try many different random subsets of the corresponding point pairs (of four pairs each, collinear pairs are discarded), estimate the homography matrix using this subset and a simple least-squares algorithm, and then compute the quality/goodness of the computed homography (which is the number of inliers for RANSAC or the least median re-projection error for LMeDS). The best subset is then used to produce the initial estimate of the homography matrix and the mask of inliers/outliers. Regardless of the method, robust or not, the computed homography matrix is refined further (using inliers only in case of a robust method) with the Levenberg-Marquardt method to reduce the re-projection error even more. The methods RANSAC and RHO can handle practically any ratio of outliers but need a threshold to distinguish inliers from outliers. The method LMeDS does not need any threshold but it works correctly only when there are more than 50% of inliers. Finally, if there are no outliers and the noise is rather small, use the default method (method=0). The function is used to find initial intrinsic and extrinsic matrices. Homography matrix is determined up to a scale. If \(h_{33}\) is non-zero, the matrix is normalized so that \(h_{33}=1\). 覚え書き: Whenever an \(H\) matrix cannot be estimated, an empty one will be returned. SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform
        戻り値:
        自動生成
      • RQDecomp3x3

        public static double[] RQDecomp3x3​(Mat src,
                                           Mat mtxR,
                                           Mat mtxQ,
                                           Mat Qx,
                                           Mat Qy,
                                           Mat Qz)
        Computes an RQ decomposition of 3x3 matrices.
        引数:
        src - 3x3 の入力行列。
        mtxR - 出力される 3x3 の上三角行列。
        mtxQ - 出力される 3x3 の直交行列。
        Qx - 省略可能。出力される x 軸まわりの 3x3 回転行列。
        Qy - 省略可能。出力される y 軸まわりの 3x3 回転行列。
        Qz - 省略可能。出力される z 軸まわりの 3x3 回転行列。この関数は与えられた回転を用いて RQ 分解を計算する。この関数は #decomposeProjectionMatrix の内部で、射影行列の左側 3x3 部分行列をカメラ行列と回転行列に分解するために使用される。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる度単位の3つのオイラー角(戻り値として)を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。
        戻り値:
        自動生成
      • RQDecomp3x3

        public static double[] RQDecomp3x3​(Mat src,
                                           Mat mtxR,
                                           Mat mtxQ,
                                           Mat Qx,
                                           Mat Qy)
        Computes an RQ decomposition of 3x3 matrices.
        引数:
        src - 3x3 の入力行列。
        mtxR - 出力される 3x3 の上三角行列。
        mtxQ - 出力される 3x3 の直交行列。
        Qx - 省略可能。出力される x 軸まわりの 3x3 回転行列。
        Qy - 省略可能。出力される y 軸まわりの 3x3 回転行列。この関数は与えられた回転を用いて RQ 分解を計算する。この関数は #decomposeProjectionMatrix の内部で、射影行列の左側 3x3 部分行列をカメラ行列と回転行列に分解するために使用される。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる度単位の3つのオイラー角(戻り値として)を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。
        戻り値:
        自動生成
      • RQDecomp3x3

        public static double[] RQDecomp3x3​(Mat src,
                                           Mat mtxR,
                                           Mat mtxQ,
                                           Mat Qx)
        Computes an RQ decomposition of 3x3 matrices.
        引数:
        src - 3x3 の入力行列。
        mtxR - 出力される 3x3 の上三角行列。
        mtxQ - 出力される 3x3 の直交行列。
        Qx - 省略可能。出力される x 軸まわりの 3x3 回転行列。この関数は与えられた回転を用いて RQ 分解を計算する。この関数は #decomposeProjectionMatrix の内部で、射影行列の左側 3x3 部分行列をカメラ行列と回転行列に分解するために使用される。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる度単位の3つのオイラー角(戻り値として)を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。
        戻り値:
        自動生成
      • RQDecomp3x3

        public static double[] RQDecomp3x3​(Mat src,
                                           Mat mtxR,
                                           Mat mtxQ)
        Computes an RQ decomposition of 3x3 matrices.
        引数:
        src - 3x3 の入力行列。
        mtxR - 出力される 3x3 の上三角行列。
        mtxQ - 出力される 3x3 の直交行列。この関数は与えられた回転を用いて RQ 分解を計算する。この関数は #decomposeProjectionMatrix の内部で、射影行列の左側 3x3 部分行列をカメラ行列と回転行列に分解するために使用される。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる度単位の3つのオイラー角(戻り値として)を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。
        戻り値:
        自動生成
      • decomposeProjectionMatrix

        public static void decomposeProjectionMatrix​(Mat projMatrix,
                                                     Mat cameraMatrix,
                                                     Mat rotMatrix,
                                                     Mat transVect,
                                                     Mat rotMatrixX,
                                                     Mat rotMatrixY,
                                                     Mat rotMatrixZ,
                                                     Mat eulerAngles)
        Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.
        引数:
        projMatrix - 3x4 の入力射影行列 P。
        cameraMatrix - 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。
        rotMatrix - 出力される 3x3 の外部回転行列 R。
        transVect - 出力される 4x1 の並進ベクトル T。
        rotMatrixX - 省略可能な x 軸まわりの 3x3 回転行列。
        rotMatrixY - 省略可能な y 軸まわりの 3x3 回転行列。
        rotMatrixZ - 省略可能な z 軸まわりの 3x3 回転行列。
        eulerAngles - 省略可能。度単位の3つの回転オイラー角を含む3要素ベクトル。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
      • decomposeProjectionMatrix

        public static void decomposeProjectionMatrix​(Mat projMatrix,
                                                     Mat cameraMatrix,
                                                     Mat rotMatrix,
                                                     Mat transVect,
                                                     Mat rotMatrixX,
                                                     Mat rotMatrixY,
                                                     Mat rotMatrixZ)
        Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.
        引数:
        projMatrix - 3x4 の入力射影行列 P。
        cameraMatrix - 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。
        rotMatrix - 出力される 3x3 の外部回転行列 R。
        transVect - 出力される 4x1 の並進ベクトル T。
        rotMatrixX - 省略可能な x 軸まわりの 3x3 回転行列。
        rotMatrixY - 省略可能な y 軸まわりの 3x3 回転行列。
        rotMatrixZ - 省略可能な z 軸まわりの 3x3 回転行列。度単位。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
      • decomposeProjectionMatrix

        public static void decomposeProjectionMatrix​(Mat projMatrix,
                                                     Mat cameraMatrix,
                                                     Mat rotMatrix,
                                                     Mat transVect,
                                                     Mat rotMatrixX,
                                                     Mat rotMatrixY)
        Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.
        引数:
        projMatrix - 3x4 の入力射影行列 P。
        cameraMatrix - 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。
        rotMatrix - 出力される 3x3 の外部回転行列 R。
        transVect - 出力される 4x1 の並進ベクトル T。
        rotMatrixX - 省略可能な x 軸まわりの 3x3 回転行列。
        rotMatrixY - 省略可能な y 軸まわりの 3x3 回転行列。度単位。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
      • decomposeProjectionMatrix

        public static void decomposeProjectionMatrix​(Mat projMatrix,
                                                     Mat cameraMatrix,
                                                     Mat rotMatrix,
                                                     Mat transVect,
                                                     Mat rotMatrixX)
        Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.
        引数:
        projMatrix - 3x4 の入力射影行列 P。
        cameraMatrix - 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。
        rotMatrix - 出力される 3x3 の外部回転行列 R。
        transVect - 出力される 4x1 の並進ベクトル T。
        rotMatrixX - 省略可能な x 軸まわりの 3x3 回転行列。度単位。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
      • decomposeProjectionMatrix

        public static void decomposeProjectionMatrix​(Mat projMatrix,
                                                     Mat cameraMatrix,
                                                     Mat rotMatrix,
                                                     Mat transVect)
        Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.
        引数:
        projMatrix - 3x4 の入力射影行列 P。
        cameraMatrix - 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。
        rotMatrix - 出力される 3x3 の外部回転行列 R。
        transVect - 出力される 4x1 の並進ベクトル T。度単位。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
      • matMulDeriv

        public static void matMulDeriv​(Mat A,
                                       Mat B,
                                       Mat dABdA,
                                       Mat dABdB)
        Computes partial derivatives of the matrix product for each multiplied matrix.
        引数:
        A - 乗算される第1の行列。
        B - 乗算される第2の行列。
        dABdA - 出力される第1の微分行列 d(A\*B)/dA。サイズは \(\texttt{A.rows*B.cols} \times {A.rows*A.cols}\)。
        dABdB - 出力される第2の微分行列 d(A\*B)/dB。サイズは \(\texttt{A.rows*B.cols} \times {B.rows*B.cols}\)。この関数は、行列積 \(A*B\) の各要素を、2つの入力行列それぞれの各要素について偏微分したものを計算する。この関数は #stereoCalibrate でヤコビ行列を計算するために使用されるが、同様の最適化関数であれば他のものにも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3,
                                     Mat dr3dr1,
                                     Mat dr3dt1,
                                     Mat dr3dr2,
                                     Mat dr3dt2,
                                     Mat dt3dr1,
                                     Mat dt3dt1,
                                     Mat dt3dr2,
                                     Mat dt3dt2)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。
        dr3dr1 - 省略可能。rvec1 に関する rvec3 の微分の出力
        dr3dt1 - 省略可能。tvec1 に関する rvec3 の微分の出力
        dr3dr2 - 省略可能。rvec2 に関する rvec3 の微分の出力
        dr3dt2 - 省略可能。tvec2 に関する rvec3 の微分の出力
        dt3dr1 - 省略可能。rvec1 に関する tvec3 の微分の出力
        dt3dt1 - 省略可能。tvec1 に関する tvec3 の微分の出力
        dt3dr2 - 省略可能。rvec2 に関する tvec3 の微分の出力
        dt3dt2 - 省略可能。tvec2 に関する tvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3,
                                     Mat dr3dr1,
                                     Mat dr3dt1,
                                     Mat dr3dr2,
                                     Mat dr3dt2,
                                     Mat dt3dr1,
                                     Mat dt3dt1,
                                     Mat dt3dr2)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。
        dr3dr1 - 省略可能。rvec1 に関する rvec3 の微分の出力
        dr3dt1 - 省略可能。tvec1 に関する rvec3 の微分の出力
        dr3dr2 - 省略可能。rvec2 に関する rvec3 の微分の出力
        dr3dt2 - 省略可能。tvec2 に関する rvec3 の微分の出力
        dt3dr1 - 省略可能。rvec1 に関する tvec3 の微分の出力
        dt3dt1 - 省略可能。tvec1 に関する tvec3 の微分の出力
        dt3dr2 - 省略可能。rvec2 に関する tvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3,
                                     Mat dr3dr1,
                                     Mat dr3dt1,
                                     Mat dr3dr2,
                                     Mat dr3dt2,
                                     Mat dt3dr1,
                                     Mat dt3dt1)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。
        dr3dr1 - 省略可能。rvec1 に関する rvec3 の微分の出力
        dr3dt1 - 省略可能。tvec1 に関する rvec3 の微分の出力
        dr3dr2 - 省略可能。rvec2 に関する rvec3 の微分の出力
        dr3dt2 - 省略可能。tvec2 に関する rvec3 の微分の出力
        dt3dr1 - 省略可能。rvec1 に関する tvec3 の微分の出力
        dt3dt1 - 省略可能。tvec1 に関する tvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3,
                                     Mat dr3dr1,
                                     Mat dr3dt1,
                                     Mat dr3dr2,
                                     Mat dr3dt2,
                                     Mat dt3dr1)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。
        dr3dr1 - 省略可能。rvec1 に関する rvec3 の微分の出力
        dr3dt1 - 省略可能。tvec1 に関する rvec3 の微分の出力
        dr3dr2 - 省略可能。rvec2 に関する rvec3 の微分の出力
        dr3dt2 - 省略可能。tvec2 に関する rvec3 の微分の出力
        dt3dr1 - 省略可能。rvec1 に関する tvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3,
                                     Mat dr3dr1,
                                     Mat dr3dt1,
                                     Mat dr3dr2,
                                     Mat dr3dt2)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。
        dr3dr1 - 省略可能。rvec1 に関する rvec3 の微分の出力
        dr3dt1 - 省略可能。tvec1 に関する rvec3 の微分の出力
        dr3dr2 - 省略可能。rvec2 に関する rvec3 の微分の出力
        dr3dt2 - 省略可能。tvec2 に関する rvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3,
                                     Mat dr3dr1,
                                     Mat dr3dt1,
                                     Mat dr3dr2)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。
        dr3dr1 - 省略可能。rvec1 に関する rvec3 の微分の出力
        dr3dt1 - 省略可能。tvec1 に関する rvec3 の微分の出力
        dr3dr2 - 省略可能。rvec2 に関する rvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3,
                                     Mat dr3dr1,
                                     Mat dr3dt1)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。
        dr3dr1 - 省略可能。rvec1 に関する rvec3 の微分の出力
        dr3dt1 - 省略可能。tvec1 に関する rvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3,
                                     Mat dr3dr1)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。
        dr3dr1 - 省略可能。rvec1 に関する rvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • composeRT

        public static void composeRT​(Mat rvec1,
                                     Mat tvec1,
                                     Mat rvec2,
                                     Mat tvec2,
                                     Mat rvec3,
                                     Mat tvec3)
        Combines two rotation-and-shift transformations.
        引数:
        rvec1 - 第1の回転ベクトル。
        tvec1 - 第1の並進ベクトル。
        rvec2 - 第2の回転ベクトル。
        tvec2 - 第2の並進ベクトル。
        rvec3 - 合成結果の出力回転ベクトル。
        tvec3 - 合成結果の出力並進ベクトル。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
      • projectPoints

        public static void projectPoints​(MatOfPoint3f objectPoints,
                                         Mat rvec,
                                         Mat tvec,
                                         Mat cameraMatrix,
                                         MatOfDouble distCoeffs,
                                         MatOfPoint2f imagePoints,
                                         Mat jacobian,
                                         double aspectRatio)
        Projects 3D points to an image plane.
        引数:
        objectPoints - ワールド座標系で表されたオブジェクト点の配列。3xN/Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネル(あるいは vector<Point3f> )であり、N はそのビューにおける点の数。
        rvec - 回転ベクトル(REF: Rodrigues)。tvec とともに、ワールド座標系からカメラ座標系への基底変換を行う。詳細は REF: calibrateCamera を参照。
        tvec - 並進ベクトル。上記の引数説明を参照。
        cameraMatrix - カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが空の場合、歪み係数はすべてゼロと仮定される。
        imagePoints - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。
        jacobian - 省略可能。出力される 2Nx(10+<numDistCoeffs>) のヤコビ行列で、画像点を、回転ベクトル・並進ベクトルの各成分、焦点距離、主点の座標、および歪み係数で微分したもの。旧インターフェースでは、ヤコビアンの各成分は異なる出力引数を介して返される。
        aspectRatio - 省略可能な「固定アスペクト比」引数。この引数が 0 でない場合、関数はアスペクト比(\(f_x / f_y\))が固定であると仮定し、それに応じてヤコビ行列を調整する。この関数は、カメラの内部・外部パラメータを与えて、3D 点の画像平面への 2D 投影を計算する。省略可能で、画像点座標(すべての入力引数の関数として)を、内部・外部の特定の引数で偏微分した行列であるヤコビアンを計算する。ヤコビアンは REF: calibrateCamera、REF: solvePnP、REF: stereoCalibrate におけるグローバル最適化中に使用される。この関数自体は、現在の内部・外部パラメータを与えて再投影誤差を計算するためにも使用できる。覚え書き: rvec = tvec = \([0, 0, 0]\) と設定するか、cameraMatrix を 3x3 の単位行列に設定するか、歪み係数をすべてゼロにすることで、この関数のさまざまな有用な特殊ケースを得られる。これは、疎な点集合に対して歪んだ座標を計算したり、理想的な歪みゼロの設定で透視変換を適用(およびその微分を計算)したりできることを意味する。
      • projectPoints

        public static void projectPoints​(MatOfPoint3f objectPoints,
                                         Mat rvec,
                                         Mat tvec,
                                         Mat cameraMatrix,
                                         MatOfDouble distCoeffs,
                                         MatOfPoint2f imagePoints,
                                         Mat jacobian)
        Projects 3D points to an image plane.
        引数:
        objectPoints - ワールド座標系で表されたオブジェクト点の配列。3xN/Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネル(あるいは vector<Point3f> )であり、N はそのビューにおける点の数。
        rvec - 回転ベクトル(REF: Rodrigues)。tvec とともに、ワールド座標系からカメラ座標系への基底変換を行う。詳細は REF: calibrateCamera を参照。
        tvec - 並進ベクトル。上記の引数説明を参照。
        cameraMatrix - カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが空の場合、歪み係数はすべてゼロと仮定される。
        imagePoints - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。
        jacobian - 省略可能。出力される 2Nx(10+<numDistCoeffs>) のヤコビ行列で、画像点を、回転ベクトル・並進ベクトルの各成分、焦点距離、主点の座標、および歪み係数で微分したもの。旧インターフェースでは、ヤコビアンの各成分は異なる出力引数を介して返される。関数はアスペクト比(\(f_x / f_y\))が固定であると仮定し、それに応じてヤコビ行列を調整する。この関数は、カメラの内部・外部パラメータを与えて、3D 点の画像平面への 2D 投影を計算する。省略可能で、画像点座標(すべての入力引数の関数として)を、内部・外部の特定の引数で偏微分した行列であるヤコビアンを計算する。ヤコビアンは REF: calibrateCamera、REF: solvePnP、REF: stereoCalibrate におけるグローバル最適化中に使用される。この関数自体は、現在の内部・外部パラメータを与えて再投影誤差を計算するためにも使用できる。覚え書き: rvec = tvec = \([0, 0, 0]\) と設定するか、cameraMatrix を 3x3 の単位行列に設定するか、歪み係数をすべてゼロにすることで、この関数のさまざまな有用な特殊ケースを得られる。これは、疎な点集合に対して歪んだ座標を計算したり、理想的な歪みゼロの設定で透視変換を適用(およびその微分を計算)したりできることを意味する。
      • projectPoints

        public static void projectPoints​(MatOfPoint3f objectPoints,
                                         Mat rvec,
                                         Mat tvec,
                                         Mat cameraMatrix,
                                         MatOfDouble distCoeffs,
                                         MatOfPoint2f imagePoints)
        Projects 3D points to an image plane.
        引数:
        objectPoints - ワールド座標系で表されたオブジェクト点の配列。3xN/Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネル(あるいは vector<Point3f> )であり、N はそのビューにおける点の数。
        rvec - 回転ベクトル(REF: Rodrigues)。tvec とともに、ワールド座標系からカメラ座標系への基底変換を行う。詳細は REF: calibrateCamera を参照。
        tvec - 並進ベクトル。上記の引数説明を参照。
        cameraMatrix - カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが空の場合、歪み係数はすべてゼロと仮定される。
        imagePoints - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。点を、回転ベクトル・並進ベクトルの各成分、焦点距離、主点の座標、および歪み係数で微分したもの。旧インターフェースでは、ヤコビアンの各成分は異なる出力引数を介して返される。関数はアスペクト比(\(f_x / f_y\))が固定であると仮定し、それに応じてヤコビ行列を調整する。この関数は、カメラの内部・外部パラメータを与えて、3D 点の画像平面への 2D 投影を計算する。省略可能で、画像点座標(すべての入力引数の関数として)を、内部・外部の特定の引数で偏微分した行列であるヤコビアンを計算する。ヤコビアンは REF: calibrateCamera、REF: solvePnP、REF: stereoCalibrate におけるグローバル最適化中に使用される。この関数自体は、現在の内部・外部パラメータを与えて再投影誤差を計算するためにも使用できる。覚え書き: rvec = tvec = \([0, 0, 0]\) と設定するか、cameraMatrix を 3x3 の単位行列に設定するか、歪み係数をすべてゼロにすることで、この関数のさまざまな有用な特殊ケースを得られる。これは、疎な点集合に対して歪んだ座標を計算したり、理想的な歪みゼロの設定で透視変換を適用(およびその微分を計算)したりできることを意味する。
      • solvePnP

        public static boolean solvePnP​(MatOfPoint3f objectPoints,
                                       MatOfPoint2f imagePoints,
                                       Mat cameraMatrix,
                                       MatOfDouble distCoeffs,
                                       Mat rvec,
                                       Mat tvec,
                                       boolean useExtrinsicGuess,
                                       int flags)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        flags - Method for solving a PnP problem: see REF: calib3d_solvePnP_flags More information about Perspective-n-Points is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE 法で useExtrinsicGuess=true の場合、最小点数は3である(3点で姿勢を計算するには十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。何らかの解が見つかった場合、関数は true を返す。解の品質評価はユーザのコードの責任である。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • solvePnP

        public static boolean solvePnP​(MatOfPoint3f objectPoints,
                                       MatOfPoint2f imagePoints,
                                       Mat cameraMatrix,
                                       MatOfDouble distCoeffs,
                                       Mat rvec,
                                       Mat tvec,
                                       boolean useExtrinsicGuess)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. More information about Perspective-n-Points is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE 法で useExtrinsicGuess=true の場合、最小点数は3である(3点で姿勢を計算するには十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。何らかの解が見つかった場合、関数は true を返す。解の品質評価はユーザのコードの責任である。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • solvePnP

        public static boolean solvePnP​(MatOfPoint3f objectPoints,
                                       MatOfPoint2f imagePoints,
                                       Mat cameraMatrix,
                                       MatOfDouble distCoeffs,
                                       Mat rvec,
                                       Mat tvec)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - Output translation vector. the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. More information about Perspective-n-Points is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE 法で useExtrinsicGuess=true の場合、最小点数は3である(3点で姿勢を計算するには十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。何らかの解が見つかった場合、関数は true を返す。解の品質評価はユーザのコードの責任である。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • solvePnPRansac

        public static boolean solvePnPRansac​(MatOfPoint3f objectPoints,
                                             MatOfPoint2f imagePoints,
                                             Mat cameraMatrix,
                                             MatOfDouble distCoeffs,
                                             Mat rvec,
                                             Mat tvec,
                                             boolean useExtrinsicGuess,
                                             int iterationsCount,
                                             float reprojectionError,
                                             double confidence,
                                             Mat inliers,
                                             int flags)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。
        iterationsCount - 反復回数。
        reprojectionError - RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。
        confidence - アルゴリズムが有用な結果を生成する確率。
        inliers - objectPoints と imagePoints 内のインライアのインデックスを格納する出力ベクトル。
        flags - Method for solving a PnP problem (see REF: solvePnP ). The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic matrix and the distortion coefficients. This function finds such a pose that minimizes reprojection error, that is, the sum of squared distances between the observed projections imagePoints and the projected (using REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:
        • オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
        • The default method used to estimate the camera pose for the Minimal Sample Sets step is #SOLVEPNP_EPNP. Exceptions are:
          • #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
          • 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
        • すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
        戻り値:
        自動生成
      • solvePnPRansac

        public static boolean solvePnPRansac​(MatOfPoint3f objectPoints,
                                             MatOfPoint2f imagePoints,
                                             Mat cameraMatrix,
                                             MatOfDouble distCoeffs,
                                             Mat rvec,
                                             Mat tvec,
                                             boolean useExtrinsicGuess,
                                             int iterationsCount,
                                             float reprojectionError,
                                             double confidence,
                                             Mat inliers)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。
        iterationsCount - 反復回数。
        reprojectionError - RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。
        confidence - アルゴリズムが有用な結果を生成する確率。
        inliers - Output vector that contains indices of inliers in objectPoints and imagePoints . The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic matrix and the distortion coefficients. This function finds such a pose that minimizes reprojection error, that is, the sum of squared distances between the observed projections imagePoints and the projected (using REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:
        • オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
        • The default method used to estimate the camera pose for the Minimal Sample Sets step is #SOLVEPNP_EPNP. Exceptions are:
          • #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
          • 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
        • すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
        戻り値:
        自動生成
      • solvePnPRansac

        public static boolean solvePnPRansac​(MatOfPoint3f objectPoints,
                                             MatOfPoint2f imagePoints,
                                             Mat cameraMatrix,
                                             MatOfDouble distCoeffs,
                                             Mat rvec,
                                             Mat tvec,
                                             boolean useExtrinsicGuess,
                                             int iterationsCount,
                                             float reprojectionError,
                                             double confidence)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。
        iterationsCount - 反復回数。
        reprojectionError - RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。
        confidence - The probability that the algorithm produces a useful result. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic matrix and the distortion coefficients. This function finds such a pose that minimizes reprojection error, that is, the sum of squared distances between the observed projections imagePoints and the projected (using REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:
        • オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
        • The default method used to estimate the camera pose for the Minimal Sample Sets step is #SOLVEPNP_EPNP. Exceptions are:
          • #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
          • 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
        • すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
        戻り値:
        自動生成
      • solvePnPRansac

        public static boolean solvePnPRansac​(MatOfPoint3f objectPoints,
                                             MatOfPoint2f imagePoints,
                                             Mat cameraMatrix,
                                             MatOfDouble distCoeffs,
                                             Mat rvec,
                                             Mat tvec,
                                             boolean useExtrinsicGuess,
                                             int iterationsCount,
                                             float reprojectionError)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。
        iterationsCount - 反復回数。
        reprojectionError - Inlier threshold value used by the RANSAC procedure. The parameter value is the maximum allowed distance between the observed and computed point projections to consider it an inlier. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic matrix and the distortion coefficients. This function finds such a pose that minimizes reprojection error, that is, the sum of squared distances between the observed projections imagePoints and the projected (using REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:
        • オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
        • The default method used to estimate the camera pose for the Minimal Sample Sets step is #SOLVEPNP_EPNP. Exceptions are:
          • #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
          • 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
        • すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
        戻り値:
        自動生成
      • solvePnPRansac

        public static boolean solvePnPRansac​(MatOfPoint3f objectPoints,
                                             MatOfPoint2f imagePoints,
                                             Mat cameraMatrix,
                                             MatOfDouble distCoeffs,
                                             Mat rvec,
                                             Mat tvec,
                                             boolean useExtrinsicGuess,
                                             int iterationsCount)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。
        iterationsCount - Number of iterations. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic matrix and the distortion coefficients. This function finds such a pose that minimizes reprojection error, that is, the sum of squared distances between the observed projections imagePoints and the projected (using REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:
        • オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
        • The default method used to estimate the camera pose for the Minimal Sample Sets step is #SOLVEPNP_EPNP. Exceptions are:
          • #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
          • 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
        • すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
        戻り値:
        自動生成
      • solvePnPRansac

        public static boolean solvePnPRansac​(MatOfPoint3f objectPoints,
                                             MatOfPoint2f imagePoints,
                                             Mat cameraMatrix,
                                             MatOfDouble distCoeffs,
                                             Mat rvec,
                                             Mat tvec,
                                             boolean useExtrinsicGuess)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - Parameter used for REF: SOLVEPNP_ITERATIVE. If true (1), the function uses the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic matrix and the distortion coefficients. This function finds such a pose that minimizes reprojection error, that is, the sum of squared distances between the observed projections imagePoints and the projected (using REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:
        • オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
        • The default method used to estimate the camera pose for the Minimal Sample Sets step is #SOLVEPNP_EPNP. Exceptions are:
          • #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
          • 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
        • すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
        戻り値:
        自動生成
      • solvePnPRansac

        public static boolean solvePnPRansac​(MatOfPoint3f objectPoints,
                                             MatOfPoint2f imagePoints,
                                             Mat cameraMatrix,
                                             MatOfDouble distCoeffs,
                                             Mat rvec,
                                             Mat tvec)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - Output translation vector. the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic matrix and the distortion coefficients. This function finds such a pose that minimizes reprojection error, that is, the sum of squared distances between the observed projections imagePoints and the projected (using REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:
        • オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
        • The default method used to estimate the camera pose for the Minimal Sample Sets step is #SOLVEPNP_EPNP. Exceptions are:
          • #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
          • 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
        • すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
        戻り値:
        自動生成
      • solveP3P

        public static int solveP3P​(Mat objectPoints,
                                   Mat imagePoints,
                                   Mat cameraMatrix,
                                   Mat distCoeffs,
                                   java.util.List<Mat> rvecs,
                                   java.util.List<Mat> tvecs,
                                   int flags)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3 3D-2D point correspondences. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。3x3 1チャンネルまたは 1x3/3x1 3チャンネル。vector<Point3f> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。3x2 1チャンネルまたは 1x3/3x1 2チャンネル。vector<Point2f> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvecs - 出力回転ベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。P3P問題には最大4つの解がある。
        tvecs - 出力並進ベクトル。
        flags - Method for solving a P3P problem:
        • REF: SOLVEPNP_P3P メソッドは、Ding, Y., Yang, J., Larsson, V., Olsson, C., & Åstrom, K. の論文 "Revisiting the P3P Problem" (CITE: ding2023revisiting) に基づく。
        • REF: SOLVEPNP_AP3P メソッドは、T. Ke と S. Roumeliotis の論文 "An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (CITE: Ke17) に基づく。
        The function estimates the object pose given 3 object points, their corresponding image projections, as well as the camera intrinsic matrix and the distortion coefficients. 覚え書き: The solutions are sorted by reprojection errors (lowest to highest).
        戻り値:
        自動生成
      • solvePnPRefineLM

        public static void solvePnPRefineLM​(Mat objectPoints,
                                            Mat imagePoints,
                                            Mat cameraMatrix,
                                            Mat distCoeffs,
                                            Mat rvec,
                                            Mat tvec,
                                            TermCriteria criteria)
        Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。
        tvec - 入力/出力並進ベクトル。入力値は初期解として使用される。
        criteria - Levenberg-Marquardt反復アルゴリズムを停止する基準。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、Levenberg-Marquardt反復最小化 CITE: Madsen04 CITE: Eade13 プロセスに従って、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
      • solvePnPRefineLM

        public static void solvePnPRefineLM​(Mat objectPoints,
                                            Mat imagePoints,
                                            Mat cameraMatrix,
                                            Mat distCoeffs,
                                            Mat rvec,
                                            Mat tvec)
        Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。
        tvec - 入力/出力並進ベクトル。入力値は初期解として使用される。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、Levenberg-Marquardt反復最小化 CITE: Madsen04 CITE: Eade13 プロセスに従って、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
      • solvePnPRefineVVS

        public static void solvePnPRefineVVS​(Mat objectPoints,
                                             Mat imagePoints,
                                             Mat cameraMatrix,
                                             Mat distCoeffs,
                                             Mat rvec,
                                             Mat tvec,
                                             TermCriteria criteria,
                                             double VVSlambda)
        Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。
        tvec - 入力/出力並進ベクトル。入力値は初期解として使用される。
        criteria - Levenberg-Marquardt反復アルゴリズムを停止する基準。
        VVSlambda - 仮想視覚サーボ制御則のゲイン。減衰ガウス・ニュートン定式化における \(\alpha\) ゲインに相当する。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、仮想視覚サーボ (VVS) CITE: Chaumette06 CITE: Marchand16 方式を用いて、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
      • solvePnPRefineVVS

        public static void solvePnPRefineVVS​(Mat objectPoints,
                                             Mat imagePoints,
                                             Mat cameraMatrix,
                                             Mat distCoeffs,
                                             Mat rvec,
                                             Mat tvec,
                                             TermCriteria criteria)
        Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。
        tvec - 入力/出力並進ベクトル。入力値は初期解として使用される。
        criteria - Levenberg-Marquardt反復アルゴリズムを停止する基準。減衰ガウス・ニュートン定式化におけるゲイン。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、仮想視覚サーボ (VVS) CITE: Chaumette06 CITE: Marchand16 方式を用いて、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
      • solvePnPRefineVVS

        public static void solvePnPRefineVVS​(Mat objectPoints,
                                             Mat imagePoints,
                                             Mat cameraMatrix,
                                             Mat distCoeffs,
                                             Mat rvec,
                                             Mat tvec)
        Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvec - 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。
        tvec - 入力/出力並進ベクトル。入力値は初期解として使用される。減衰ガウス・ニュートン定式化におけるゲイン。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、仮想視覚サーボ (VVS) CITE: Chaumette06 CITE: Marchand16 方式を用いて、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
      • solvePnPGeneric

        public static int solvePnPGeneric​(Mat objectPoints,
                                          Mat imagePoints,
                                          Mat cameraMatrix,
                                          Mat distCoeffs,
                                          java.util.List<Mat> rvecs,
                                          java.util.List<Mat> tvecs,
                                          boolean useExtrinsicGuess,
                                          int flags,
                                          Mat rvec,
                                          Mat tvec,
                                          Mat reprojectionError)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:
        • P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
        • REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvecs - 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvecs - 出力並進ベクトルのベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        flags - PnP問題を解くためのメソッド: REF: calib3d_solvePnP_flags を参照
        rvec - flag が REF: SOLVEPNP_ITERATIVE で useExtrinsicGuess が true に設定されている場合に、反復的なPnP精緻化アルゴリズムを初期化するために使用される回転ベクトル。
        tvec - flag が REF: SOLVEPNP_ITERATIVE で useExtrinsicGuess が true に設定されている場合に、反復的なPnP精緻化アルゴリズムを初期化するために使用される並進ベクトル。
        reprojectionError - Optional vector of reprojection error, that is the RMS error (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE メソッドかつ useExtrinsicGuess=true の場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • solvePnPGeneric

        public static int solvePnPGeneric​(Mat objectPoints,
                                          Mat imagePoints,
                                          Mat cameraMatrix,
                                          Mat distCoeffs,
                                          java.util.List<Mat> rvecs,
                                          java.util.List<Mat> tvecs,
                                          boolean useExtrinsicGuess,
                                          int flags,
                                          Mat rvec,
                                          Mat tvec)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:
        • P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
        • REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvecs - 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvecs - 出力並進ベクトルのベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        flags - PnP問題を解くためのメソッド: REF: calib3d_solvePnP_flags を参照
        rvec - flag が REF: SOLVEPNP_ITERATIVE で useExtrinsicGuess が true に設定されている場合に、反復的なPnP精緻化アルゴリズムを初期化するために使用される回転ベクトル。
        tvec - Translation vector used to initialize an iterative PnP refinement algorithm, when flag is REF: SOLVEPNP_ITERATIVE and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE メソッドかつ useExtrinsicGuess=true の場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • solvePnPGeneric

        public static int solvePnPGeneric​(Mat objectPoints,
                                          Mat imagePoints,
                                          Mat cameraMatrix,
                                          Mat distCoeffs,
                                          java.util.List<Mat> rvecs,
                                          java.util.List<Mat> tvecs,
                                          boolean useExtrinsicGuess,
                                          int flags,
                                          Mat rvec)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:
        • P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
        • REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvecs - 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvecs - 出力並進ベクトルのベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        flags - PnP問題を解くためのメソッド: REF: calib3d_solvePnP_flags を参照
        rvec - Rotation vector used to initialize an iterative PnP refinement algorithm, when flag is REF: SOLVEPNP_ITERATIVE and useExtrinsicGuess is set to true. and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE メソッドかつ useExtrinsicGuess=true の場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • solvePnPGeneric

        public static int solvePnPGeneric​(Mat objectPoints,
                                          Mat imagePoints,
                                          Mat cameraMatrix,
                                          Mat distCoeffs,
                                          java.util.List<Mat> rvecs,
                                          java.util.List<Mat> tvecs,
                                          boolean useExtrinsicGuess,
                                          int flags)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:
        • P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
        • REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvecs - 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvecs - 出力並進ベクトルのベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        flags - Method for solving a PnP problem: see REF: calib3d_solvePnP_flags and useExtrinsicGuess is set to true. and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE メソッドかつ useExtrinsicGuess=true の場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • solvePnPGeneric

        public static int solvePnPGeneric​(Mat objectPoints,
                                          Mat imagePoints,
                                          Mat cameraMatrix,
                                          Mat distCoeffs,
                                          java.util.List<Mat> rvecs,
                                          java.util.List<Mat> tvecs,
                                          boolean useExtrinsicGuess)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:
        • P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
        • REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvecs - 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvecs - 出力並進ベクトルのベクトル。
        useExtrinsicGuess - Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. and useExtrinsicGuess is set to true. and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE メソッドかつ useExtrinsicGuess=true の場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • solvePnPGeneric

        public static int solvePnPGeneric​(Mat objectPoints,
                                          Mat imagePoints,
                                          Mat cameraMatrix,
                                          Mat distCoeffs,
                                          java.util.List<Mat> rvecs,
                                          java.util.List<Mat> tvecs)
        Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. ![Perspective projection, from object to camera frame](pics/pinhole_homogeneous_transformation.png){ width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:
        • P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
        • REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
        • REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        rvecs - 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvecs - Vector of output translation vectors. the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. and useExtrinsicGuess is set to true. and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:
        • 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
        • If you are using Python:
          • Numpy 配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 55 行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)。
          • P3P アルゴリズムは、内部で #undistortPoints を呼び出す(modules/calib3d/src/solvepnp.cpp バージョン 2.4.9 の 75 行目付近)ため、画像点が (N,1,2) の形状の配列であることを要求する。これは2チャンネルの情報を必要とするためである。
          • したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
        • REF: SOLVEPNP_DLS および REF: SOLVEPNP_UPNP の手法は、現在の実装が不安定で、まったく誤った結果を返すことがあるため使用できない。これら2つのフラグのいずれかを渡した場合は、代わりに REF: SOLVEPNP_EPNP 法が使用される。
        • 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
        • REF: SOLVEPNP_ITERATIVE メソッドかつ useExtrinsicGuess=true の場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。
        • REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
          • 点 0: [-squareLength / 2, squareLength / 2, 0]
          • 点 1: [ squareLength / 2, squareLength / 2, 0]
          • 点 2: [ squareLength / 2, -squareLength / 2, 0]
          • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
        戻り値:
        自動生成
      • initCameraMatrix2D

        public static Mat initCameraMatrix2D​(java.util.List<MatOfPoint3f> objectPoints,
                                             java.util.List<MatOfPoint2f> imagePoints,
                                             Size imageSize,
                                             double aspectRatio)
        Finds an initial camera intrinsic matrix from 3D-2D point correspondences.
        引数:
        objectPoints - キャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトル。旧インターフェースでは、ビューごとのすべてのベクトルが連結される。詳細は #calibrateCamera を参照。
        imagePoints - キャリブレーションパターン点の投影のベクトルのベクトル。旧インターフェースでは、ビューごとのすべてのベクトルが連結される。
        imageSize - 主点を初期化するために使用される、ピクセル単位の画像サイズ。
        aspectRatio - ゼロまたは負の場合、\(f_x\) と \(f_y\) は独立に推定される。それ以外の場合、\(f_x = f_y \cdot \texttt{aspectRatio}\) となる。この関数は、カメラキャリブレーション処理のための初期カメラ内部行列を推定して返す。現在、この関数は平面キャリブレーションパターンのみをサポートしている。これは各オブジェクト点のz座標が =0 となるパターンである。
        戻り値:
        自動生成
      • initCameraMatrix2D

        public static Mat initCameraMatrix2D​(java.util.List<MatOfPoint3f> objectPoints,
                                             java.util.List<MatOfPoint2f> imagePoints,
                                             Size imageSize)
        Finds an initial camera intrinsic matrix from 3D-2D point correspondences.
        引数:
        objectPoints - キャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトル。旧インターフェースでは、ビューごとのすべてのベクトルが連結される。詳細は #calibrateCamera を参照。
        imagePoints - キャリブレーションパターン点の投影のベクトルのベクトル。旧インターフェースでは、ビューごとのすべてのベクトルが連結される。
        imageSize - 主点を初期化するために使用される、ピクセル単位の画像サイズ。それ以外の場合、\(f_x = f_y \cdot \texttt{aspectRatio}\) となる。この関数は、カメラキャリブレーション処理のための初期カメラ内部行列を推定して返す。現在、この関数は平面キャリブレーションパターンのみをサポートしている。これは各オブジェクト点のz座標が =0 となるパターンである。
        戻り値:
        自動生成
      • findChessboardCorners

        public static boolean findChessboardCorners​(Mat image,
                                                    Size patternSize,
                                                    MatOfPoint2f corners,
                                                    int flags)
        Finds the positions of internal corners of the chessboard.
        引数:
        image - 入力チェスボードビュー。8ビットのグレースケールまたはカラー画像でなければならない。
        patternSize - チェスボードの行と列ごとの内側コーナーの数( patternSize = cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) )。
        corners - 検出されたコーナーの出力配列。
        flags - Various operation flags that can be zero or a combination of the following values:
        • REF: CALIB_CB_ADAPTIVE_THRESH 固定しきい値レベル(平均画像輝度から計算される)ではなく、適応的しきい値処理を使用して画像を白黒に変換する。
        • REF: CALIB_CB_NORMALIZE_IMAGE 固定または適応的しきい値処理を適用する前に、#equalizeHist で画像ガンマを正規化する。
        • REF: CALIB_CB_FILTER_QUADS 追加の基準(輪郭面積、周囲長、正方形に近い形状など)を使用して、輪郭検出段階で抽出された誤った四角形を除外する。
        • REF: CALIB_CB_FAST_CHECK 画像に対してチェスボードコーナーを探す高速チェックを実行し、見つからなければ呼び出しを打ち切る。これにより、チェスボードが観測されない退化条件において、呼び出しを劇的に高速化できる。
        • REF: CALIB_CB_PLAIN 他のすべてのフラグは無視される。入力画像はそのまま使用される。チェッカーボードを見つけやすくするための画像処理は行われない。これにより関数の実行が高速化されるが、画像が事前に適切な方法で二値化されていない場合、チェッカーボードを認識できなくなる可能性がある。
        The function attempts to determine whether the input image is a view of the chessboard pattern and locate the internal chessboard corners. The function returns a non-zero value if all of the corners are found and they are placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns 0. For example, a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black squares touch each other. The detected coordinates are approximate, and to determine their positions more accurately, the function calls #cornerSubPix. You also may use the function #cornerSubPix with different parameters if returned coordinates are not accurate enough. Sample usage of detecting and drawing chessboard corners: : Size patternsize(8,6); //interior number of corners Mat gray = ....; //source image vector<Point2f> corners; //this will be filled by the detected corners //CALIB_CB_FAST_CHECK saves a lot of time on images //that do not contain any chessboard corners bool patternfound = findChessboardCorners(gray, patternsize, corners, CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE + CALIB_CB_FAST_CHECK); if(patternfound) cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1), TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1)); drawChessboardCorners(img, patternsize, Mat(corners), patternfound); 覚え書き: The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails. Use the generate_pattern.py Python script (REF: tutorial_camera_calibration_pattern) to create the desired checkerboard pattern.
        戻り値:
        自動生成
      • findChessboardCorners

        public static boolean findChessboardCorners​(Mat image,
                                                    Size patternSize,
                                                    MatOfPoint2f corners)
        Finds the positions of internal corners of the chessboard.
        引数:
        image - 入力チェスボードビュー。8ビットのグレースケールまたはカラー画像でなければならない。
        patternSize - チェスボードの行と列ごとの内側コーナーの数( patternSize = cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) )。
        corners - Output array of detected corners.
        • REF: CALIB_CB_ADAPTIVE_THRESH 固定しきい値レベル(平均画像輝度から計算される)ではなく、適応的しきい値処理を使用して画像を白黒に変換する。
        • REF: CALIB_CB_NORMALIZE_IMAGE 固定または適応的しきい値処理を適用する前に、#equalizeHist で画像ガンマを正規化する。
        • REF: CALIB_CB_FILTER_QUADS 追加の基準(輪郭面積、周囲長、正方形に近い形状など)を使用して、輪郭検出段階で抽出された誤った四角形を除外する。
        • REF: CALIB_CB_FAST_CHECK 画像に対してチェスボードコーナーを探す高速チェックを実行し、見つからなければ呼び出しを打ち切る。これにより、チェスボードが観測されない退化条件において、呼び出しを劇的に高速化できる。
        • REF: CALIB_CB_PLAIN 他のすべてのフラグは無視される。入力画像はそのまま使用される。チェッカーボードを見つけやすくするための画像処理は行われない。これにより関数の実行が高速化されるが、画像が事前に適切な方法で二値化されていない場合、チェッカーボードを認識できなくなる可能性がある。
        The function attempts to determine whether the input image is a view of the chessboard pattern and locate the internal chessboard corners. The function returns a non-zero value if all of the corners are found and they are placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns 0. For example, a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black squares touch each other. The detected coordinates are approximate, and to determine their positions more accurately, the function calls #cornerSubPix. You also may use the function #cornerSubPix with different parameters if returned coordinates are not accurate enough. Sample usage of detecting and drawing chessboard corners: : Size patternsize(8,6); //interior number of corners Mat gray = ....; //source image vector<Point2f> corners; //this will be filled by the detected corners //CALIB_CB_FAST_CHECK saves a lot of time on images //that do not contain any chessboard corners bool patternfound = findChessboardCorners(gray, patternsize, corners, CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE + CALIB_CB_FAST_CHECK); if(patternfound) cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1), TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1)); drawChessboardCorners(img, patternsize, Mat(corners), patternfound); 覚え書き: The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails. Use the generate_pattern.py Python script (REF: tutorial_camera_calibration_pattern) to create the desired checkerboard pattern.
        戻り値:
        自動生成
      • checkChessboard

        public static boolean checkChessboard​(Mat img,
                                              Size size)
      • findChessboardCornersSBWithMeta

        public static boolean findChessboardCornersSBWithMeta​(Mat image,
                                                              Size patternSize,
                                                              Mat corners,
                                                              int flags,
                                                              Mat meta)
        Finds the positions of internal corners of the chessboard using a sector based approach.
        引数:
        image - 入力チェスボードビュー。8ビットのグレースケールまたはカラー画像でなければならない。
        patternSize - チェスボードの行と列ごとの内側コーナーの数( patternSize = cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) )。
        corners - 検出されたコーナーの出力配列。
        flags - Various operation flags that can be zero or a combination of the following values:
        • REF: CALIB_CB_NORMALIZE_IMAGE 検出前に equalizeHist で画像ガンマを正規化する。
        • REF: CALIB_CB_EXHAUSTIVE 検出率を向上させるために全数探索を実行する。
        • REF: CALIB_CB_ACCURACY エイリアシング効果によるサブピクセル精度を向上させるために、入力画像をアップサンプリングする。
        • REF: CALIB_CB_LARGER 検出されたパターンが patternSize より大きくなることを許可する(説明を参照)。
        • REF: CALIB_CB_MARKER 検出されたパターンはマーカーを持たなければならない(説明を参照)。正確なカメラキャリブレーションが必要な場合に使用すべきである。
        meta - Optional output array of detected corners (CV_8UC1 and size = cv::Size(columns,rows)). Each entry stands for one corner of the pattern and can have one of the following values:
        • 0 = メタデータが付与されていない
        • 1 = 黒いセルの左上コーナー
        • 2 = 白いセルの左上コーナー
        • 3 = 白いマーカードットを持つ黒いセルの左上コーナー
        • 4 = 黒いマーカードットを持つ白いセルの左上コーナー(マーカーがある場合はパターンの原点、ない場合は最初のコーナー)
        The function is analog to #findChessboardCorners but uses a localized radon transformation approximated by box filters being more robust to all sort of noise, faster on larger images and is able to directly return the sub-pixel position of the internal chessboard corners. The Method is based on the paper CITE: duda2018 "Accurate Detection and Localization of Checkerboard Corners for Calibration" demonstrating that the returned sub-pixel positions are more accurate than the one returned by cornerSubPix allowing a precise camera calibration for demanding applications. In the case, the flags REF: CALIB_CB_LARGER or REF: CALIB_CB_MARKER are given, the result can be recovered from the optional meta array. Both flags are helpful to use calibration patterns exceeding the field of view of the camera. These oversized patterns allow more accurate calibrations as corners can be utilized, which are as close as possible to the image borders. For a consistent coordinate system across all images, the optional marker (see image below) can be used to move the origin of the board to the location where the black circle is located. 覚え書き: The function requires a white boarder with roughly the same width as one of the checkerboard fields around the whole board to improve the detection in various environments. In addition, because of the localized radon transformation it is beneficial to use round corners for the field corners which are located on the outside of the board. The following figure illustrates a sample checkerboard optimized for the detection. However, any other checkerboard can be used as well. Use the generate_pattern.py Python script (REF: tutorial_camera_calibration_pattern) to create the corresponding checkerboard pattern: \image html pics/checkerboard_radon.png width=60%
        戻り値:
        自動生成
      • findChessboardCornersSB

        public static boolean findChessboardCornersSB​(Mat image,
                                                      Size patternSize,
                                                      Mat corners,
                                                      int flags)
      • findChessboardCornersSB

        public static boolean findChessboardCornersSB​(Mat image,
                                                      Size patternSize,
                                                      Mat corners)
      • estimateChessboardSharpness

        public static Scalar estimateChessboardSharpness​(Mat image,
                                                         Size patternSize,
                                                         Mat corners,
                                                         float rise_distance,
                                                         boolean vertical,
                                                         Mat sharpness)
        Estimates the sharpness of a detected chessboard. Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.
        引数:
        image - チェスボードコーナーを見つけるために使用されるグレー画像
        patternSize - 見つかったチェスボードパターンのサイズ
        corners - #findChessboardCornersSB で見つかったコーナー
        rise_distance - 立ち上がり距離。0.8 は最終信号強度の10% ... 90% を意味する
        vertical - デフォルトでは水平線に対するエッジ応答が計算される
        sharpness - 計算されたエッジ応答の鮮鋭度値を含む省略可能な出力配列(説明を参照)。省略可能な sharpness 配列は型 CV_32FC1 で、計算された各プロファイルについて以下の5つのエントリを持つ1行を含む: 0 = 画像内の基となるエッジのx座標 1 = 画像内の基となるエッジのy座標 2 = 遷移領域の幅(鮮鋭度) 3 = 黒セルの信号強度(最小輝度) 4 = 白セルの信号強度(最大輝度)
        戻り値:
        Scalar(平均鮮鋭度, 平均最小輝度, 平均最大輝度,0)
      • estimateChessboardSharpness

        public static Scalar estimateChessboardSharpness​(Mat image,
                                                         Size patternSize,
                                                         Mat corners,
                                                         float rise_distance,
                                                         boolean vertical)
        Estimates the sharpness of a detected chessboard. Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.
        引数:
        image - チェスボードコーナーを見つけるために使用されるグレー画像
        patternSize - 見つかったチェスボードパターンのサイズ
        corners - #findChessboardCornersSB で見つかったコーナー
        rise_distance - 立ち上がり距離。0.8 は最終信号強度の10% ... 90% を意味する
        vertical - デフォルトでは水平線に対するエッジ応答が計算される。省略可能な sharpness 配列は型 CV_32FC1 で、計算された各プロファイルについて以下の5つのエントリを持つ1行を含む: 0 = 画像内の基となるエッジのx座標 1 = 画像内の基となるエッジのy座標 2 = 遷移領域の幅(鮮鋭度) 3 = 黒セルの信号強度(最小輝度) 4 = 白セルの信号強度(最大輝度)
        戻り値:
        Scalar(平均鮮鋭度, 平均最小輝度, 平均最大輝度,0)
      • estimateChessboardSharpness

        public static Scalar estimateChessboardSharpness​(Mat image,
                                                         Size patternSize,
                                                         Mat corners,
                                                         float rise_distance)
        Estimates the sharpness of a detected chessboard. Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.
        引数:
        image - チェスボードコーナーを見つけるために使用されるグレー画像
        patternSize - 見つかったチェスボードパターンのサイズ
        corners - #findChessboardCornersSB で見つかったコーナー
        rise_distance - 立ち上がり距離。0.8 は最終信号強度の10% ... 90% を意味する。省略可能な sharpness 配列は型 CV_32FC1 で、計算された各プロファイルについて以下の5つのエントリを持つ1行を含む: 0 = 画像内の基となるエッジのx座標 1 = 画像内の基となるエッジのy座標 2 = 遷移領域の幅(鮮鋭度) 3 = 黒セルの信号強度(最小輝度) 4 = 白セルの信号強度(最大輝度)
        戻り値:
        Scalar(平均鮮鋭度, 平均最小輝度, 平均最大輝度,0)
      • estimateChessboardSharpness

        public static Scalar estimateChessboardSharpness​(Mat image,
                                                         Size patternSize,
                                                         Mat corners)
        Estimates the sharpness of a detected chessboard. Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.
        引数:
        image - チェスボードコーナーを見つけるために使用されるグレー画像
        patternSize - 見つかったチェスボードパターンのサイズ
        corners - #findChessboardCornersSB で見つかったコーナー。省略可能な sharpness 配列は型 CV_32FC1 で、計算された各プロファイルについて以下の5つのエントリを持つ1行を含む: 0 = 画像内の基となるエッジのx座標 1 = 画像内の基となるエッジのy座標 2 = 遷移領域の幅(鮮鋭度) 3 = 黒セルの信号強度(最小輝度) 4 = 白セルの信号強度(最大輝度)
        戻り値:
        Scalar(平均鮮鋭度, 平均最小輝度, 平均最大輝度,0)
      • find4QuadCornerSubpix

        public static boolean find4QuadCornerSubpix​(Mat img,
                                                    Mat corners,
                                                    Size region_size)
      • drawChessboardCorners

        public static void drawChessboardCorners​(Mat image,
                                                 Size patternSize,
                                                 MatOfPoint2f corners,
                                                 boolean patternWasFound)
        Renders the detected chessboard corners.
        引数:
        image - 出力先画像。8ビットのカラー画像でなければならない。
        patternSize - チェスボードの行と列ごとの内側コーナーの数(patternSize = cv::Size(points_per_row,points_per_column))。
        corners - 検出されたコーナーの配列。#findChessboardCorners の出力。
        patternWasFound - ボード全体が見つかったかどうかを示す引数。#findChessboardCorners の戻り値をここに渡すべきである。この関数は、ボードが見つからなかった場合は個々のチェスボードコーナーを赤い円として描画し、ボードが見つかった場合は線で接続された色付きのコーナーとして描画する。
      • drawFrameAxes

        public static void drawFrameAxes​(Mat image,
                                         Mat cameraMatrix,
                                         Mat distCoeffs,
                                         Mat rvec,
                                         Mat tvec,
                                         float length,
                                         int thickness)
        Draw axes of the world/object coordinate system from pose estimation. SEE: solvePnP
        引数:
        image - 入力/出力画像。1または3チャンネルでなければならない。チャンネル数は変更されない。
        cameraMatrix - カメラ内部パラメータの入力3x3浮動小数点行列。 \(\cameramatrix{A}\)
        distCoeffs - 歪み係数 \(\distcoeffs\) の入力ベクトル。ベクトルが空の場合、歪み係数はゼロであると仮定される。
        rvec - 回転ベクトル(REF: Rodrigues を参照)。tvec とともに、モデル座標系からカメラ座標系へ点を移す。
        tvec - 並進ベクトル。
        length - 描画する座標軸の長さ。単位は tvec と同じ(通常はメートル)。
        thickness - 描画する座標軸の線の太さ。この関数は、カメラフレームに対するワールド/物体座標系の座標軸を描画する。OX は赤、OY は緑、OZ は青で描画される。
      • drawFrameAxes

        public static void drawFrameAxes​(Mat image,
                                         Mat cameraMatrix,
                                         Mat distCoeffs,
                                         Mat rvec,
                                         Mat tvec,
                                         float length)
        Draw axes of the world/object coordinate system from pose estimation. SEE: solvePnP
        引数:
        image - 入力/出力画像。1または3チャンネルでなければならない。チャンネル数は変更されない。
        cameraMatrix - カメラ内部パラメータの入力3x3浮動小数点行列。 \(\cameramatrix{A}\)
        distCoeffs - 歪み係数 \(\distcoeffs\) の入力ベクトル。ベクトルが空の場合、歪み係数はゼロであると仮定される。
        rvec - 回転ベクトル(REF: Rodrigues を参照)。tvec とともに、モデル座標系からカメラ座標系へ点を移す。
        tvec - 並進ベクトル。
        length - 描画する座標軸の長さ。単位は tvec と同じ(通常はメートル)。この関数は、カメラフレームに対するワールド/物体座標系の座標軸を描画する。OX は赤、OY は緑、OZ は青で描画される。
      • findCirclesGrid

        public static boolean findCirclesGrid​(Mat image,
                                              Size patternSize,
                                              Mat centers,
                                              int flags)
      • findCirclesGrid

        public static boolean findCirclesGrid​(Mat image,
                                              Size patternSize,
                                              Mat centers)
      • calibrateCameraExtended

        public static double calibrateCameraExtended​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints,
                                                     Size imageSize,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs,
                                                     Mat stdDeviationsIntrinsics,
                                                     Mat stdDeviationsExtrinsics,
                                                     Mat perViewErrors,
                                                     int flags,
                                                     TermCriteria criteria)
        Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
        引数:
        objectPoints - 新しいインターフェースでは、これはキャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトルである(例: std::vector<std::vector<cv::Vec3f>>)。外側のベクトルはパターンビューの数と同じ数の要素を持つ。各ビューで同じキャリブレーションパターンが示され、それが完全に見えている場合、すべてのベクトルは同一になる。ただし、部分的に隠れたパターンや、ビューごとに異なるパターンを使用することも可能である。その場合、ベクトルは異なるものになる。点は3次元であるが、使用するキャリブレーションパターンが平面リグであれば、それらはすべてキャリブレーションパターンのXY座標平面上にある(したがってZ座標は0)。旧インターフェースでは、異なるビューからの物体点のすべてのベクトルが連結される。
        imagePoints - 新しいインターフェースでは、これはキャリブレーションパターン点の投影のベクトルのベクトルである(例: std::vector<std::vector<cv::Vec2f>>)。imagePoints.size() と objectPoints.size()、および各 i に対する imagePoints[i].size() と objectPoints[i].size() は、それぞれ等しくなければならない。旧インターフェースでは、異なるビューからの物体点のすべてのベクトルが連結される。
        imageSize - カメラ内部行列の初期化にのみ使用される画像のサイズ。
        cameraMatrix - 3x3浮動小数点のカメラ内部行列 \(\cameramatrix{A}\) の入出力。 REF: CALIB_USE_INTRINSIC_GUESS および/または REF: CALIB_FIX_ASPECT_RATIO、REF: CALIB_FIX_PRINCIPAL_POINT、REF: CALIB_FIX_FOCAL_LENGTH が指定されている場合、関数を呼び出す前に fx, fy, cx, cy の一部またはすべてを初期化しておく必要がある。
        distCoeffs - 歪み係数 \(\distcoeffs\) の入出力ベクトル。
        rvecs - 各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>>)。すなわち、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からカメラ座標空間への基底変換を行う。その双対性により、この組はカメラ座標空間に対するキャリブレーションパターンの位置と等価である。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。上記のパラメータ説明を参照。
        stdDeviationsIntrinsics - 内部パラメータについて推定された標準偏差の出力ベクトル。偏差値の順序: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) いずれかのパラメータが推定されない場合、その偏差は0となる。
        stdDeviationsExtrinsics - 外部パラメータについて推定された標準偏差の出力ベクトル。偏差値の順序: \((R_0, T_0, \dotsc , R_{M - 1}, T_{M - 1})\)。ここで M はパターンビューの数。 \(R_i, T_i\) は連結された1x3ベクトルである。
        perViewErrors - 各パターンビューについて推定されたRMS再投影誤差の出力ベクトル。
        flags - Different flags that may be zero or a combination of the following values:
        • REF: CALIB_USE_INTRINSIC_GUESS cameraMatrix には、さらに最適化される fx, fy, cx, cy の有効な初期値が含まれている。そうでない場合、(cx, cy) は初期状態で画像中心に設定され(imageSize が使用される)、焦点距離は最小二乗法で計算される。なお、内部パラメータが既知であれば、外部パラメータを推定するためだけにこの関数を使う必要はない。代わりに REF: solvePnP を使用すること。
        • REF: CALIB_FIX_PRINCIPAL_POINT 主点はグローバル最適化の間変更されない。中心、または REF: CALIB_USE_INTRINSIC_GUESS も設定されている場合に指定された別の位置にとどまる。
        • REF: CALIB_FIX_ASPECT_RATIO 関数は fy のみを自由パラメータとみなす。比 fx/fy は入力 cameraMatrix と同じままにされる。 REF: CALIB_USE_INTRINSIC_GUESS が設定されていない場合、fx と fy の実際の入力値は無視され、それらの比のみが計算されて以降使用される。
        • REF: CALIB_ZERO_TANGENT_DIST 接線歪み係数 \((p_1, p_2)\) はゼロに設定され、ゼロのままにされる。
        • REF: CALIB_FIX_FOCAL_LENGTH REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、焦点距離はグローバル最適化の間変更されない。
        • REF: CALIB_FIX_K1,..., REF: CALIB_FIX_K6 対応する半径方向歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_RATIONAL_MODEL 係数 k4, k5, k6 が有効になる。後方互換性を提供するため、キャリブレーション関数に有理モデルを使用させ、8個以上の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_THIN_PRISM_MODEL 係数 s1, s2, s3, s4 が有効になる。後方互換性を提供するため、キャリブレーション関数に薄プリズムモデルを使用させ、12個以上の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_FIX_S1_S2_S3_S4 薄プリズム歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_TILTED_MODEL 係数 tauX と tauY が有効になる。後方互換性を提供するため、キャリブレーション関数に傾斜センサモデルを使用させ、14個の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_FIX_TAUX_TAUY 傾斜センサモデルの係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        criteria - 反復最適化アルゴリズムの終了条件。
        戻り値:
        the overall RMS re-projection error. The function estimates the intrinsic camera parameters and extrinsic parameters for each of the views. The algorithm is based on CITE: Zhang2000 and CITE: BouguetMCT . The coordinates of 3D object points and their corresponding 2D projections in each view must be specified. That may be achieved by using an object with known geometry and easily detectable feature points. Such an object is called a calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as a calibration rig (see REF: findChessboardCorners). Currently, initialization of intrinsic parameters (when REF: CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration patterns (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also be used as long as initial cameraMatrix is provided. The algorithm performs the following steps:
        • 初期内部パラメータを計算する (このオプションは平面キャリブレーションパターンに対してのみ利用可能)、または入力パラメータから読み取る。CALIB_FIX_K? のいくつかが指定されていない限り、歪み係数は初期値としてすべてゼロに設定される。
        • 内部パラメータがすでに既知であるかのように、初期カメラ姿勢を推定する。これは REF: solvePnP を用いて行われる。
        • グローバルなLevenberg-Marquardt最適化アルゴリズムを実行して再投影誤差、すなわち観測された特徴点 imagePoints と投影された(現在のカメラパラメータと姿勢の推定値を用いた)物体点 objectPoints との間の二乗距離の総和を最小化する。詳細は REF: projectPoints を参照。
        覚え書き: If you use a non-square (i.e. non-N-by-N) grid and REF: findChessboardCorners for calibration, and REF: calibrateCamera returns bad values (zero distortion coefficients, \(c_x\) and \(c_y\) very far from the image center, and/or large differences between \(f_x\) and \(f_y\) (ratios of 10:1 or more)), then you are probably using patternSize=cvSize(rows,cols) instead of using patternSize=cvSize(cols,rows) in REF: findChessboardCorners. 覚え書き: The function may throw exceptions, if unsupported combination of parameters is provided or the system is underconstrained. SEE: calibrateCameraRO, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort
      • calibrateCameraExtended

        public static double calibrateCameraExtended​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints,
                                                     Size imageSize,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs,
                                                     Mat stdDeviationsIntrinsics,
                                                     Mat stdDeviationsExtrinsics,
                                                     Mat perViewErrors,
                                                     int flags)
        Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
        引数:
        objectPoints - 新しいインターフェースでは、これはキャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトルである(例: std::vector<std::vector<cv::Vec3f>>)。外側のベクトルはパターンビューの数と同じ数の要素を持つ。各ビューで同じキャリブレーションパターンが示され、それが完全に見えている場合、すべてのベクトルは同一になる。ただし、部分的に隠れたパターンや、ビューごとに異なるパターンを使用することも可能である。その場合、ベクトルは異なるものになる。点は3次元であるが、使用するキャリブレーションパターンが平面リグであれば、それらはすべてキャリブレーションパターンのXY座標平面上にある(したがってZ座標は0)。旧インターフェースでは、異なるビューからの物体点のすべてのベクトルが連結される。
        imagePoints - 新しいインターフェースでは、これはキャリブレーションパターン点の投影のベクトルのベクトルである(例: std::vector<std::vector<cv::Vec2f>>)。imagePoints.size() と objectPoints.size()、および各 i に対する imagePoints[i].size() と objectPoints[i].size() は、それぞれ等しくなければならない。旧インターフェースでは、異なるビューからの物体点のすべてのベクトルが連結される。
        imageSize - カメラ内部行列の初期化にのみ使用される画像のサイズ。
        cameraMatrix - 3x3浮動小数点のカメラ内部行列 \(\cameramatrix{A}\) の入出力。 REF: CALIB_USE_INTRINSIC_GUESS および/または REF: CALIB_FIX_ASPECT_RATIO、REF: CALIB_FIX_PRINCIPAL_POINT、REF: CALIB_FIX_FOCAL_LENGTH が指定されている場合、関数を呼び出す前に fx, fy, cx, cy の一部またはすべてを初期化しておく必要がある。
        distCoeffs - 歪み係数 \(\distcoeffs\) の入出力ベクトル。
        rvecs - 各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>>)。すなわち、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からカメラ座標空間への基底変換を行う。その双対性により、この組はカメラ座標空間に対するキャリブレーションパターンの位置と等価である。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。上記のパラメータ説明を参照。
        stdDeviationsIntrinsics - 内部パラメータについて推定された標準偏差の出力ベクトル。偏差値の順序: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) いずれかのパラメータが推定されない場合、その偏差は0となる。
        stdDeviationsExtrinsics - 外部パラメータについて推定された標準偏差の出力ベクトル。偏差値の順序: \((R_0, T_0, \dotsc , R_{M - 1}, T_{M - 1})\)。ここで M はパターンビューの数。 \(R_i, T_i\) は連結された1x3ベクトルである。
        perViewErrors - 各パターンビューについて推定されたRMS再投影誤差の出力ベクトル。
        flags - Different flags that may be zero or a combination of the following values:
        • REF: CALIB_USE_INTRINSIC_GUESS cameraMatrix には、さらに最適化される fx, fy, cx, cy の有効な初期値が含まれている。そうでない場合、(cx, cy) は初期状態で画像中心に設定され(imageSize が使用される)、焦点距離は最小二乗法で計算される。なお、内部パラメータが既知であれば、外部パラメータを推定するためだけにこの関数を使う必要はない。代わりに REF: solvePnP を使用すること。
        • REF: CALIB_FIX_PRINCIPAL_POINT 主点はグローバル最適化の間変更されない。中心、または REF: CALIB_USE_INTRINSIC_GUESS も設定されている場合に指定された別の位置にとどまる。
        • REF: CALIB_FIX_ASPECT_RATIO 関数は fy のみを自由パラメータとみなす。比 fx/fy は入力 cameraMatrix と同じままにされる。 REF: CALIB_USE_INTRINSIC_GUESS が設定されていない場合、fx と fy の実際の入力値は無視され、それらの比のみが計算されて以降使用される。
        • REF: CALIB_ZERO_TANGENT_DIST 接線歪み係数 \((p_1, p_2)\) はゼロに設定され、ゼロのままにされる。
        • REF: CALIB_FIX_FOCAL_LENGTH REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、焦点距離はグローバル最適化の間変更されない。
        • REF: CALIB_FIX_K1,..., REF: CALIB_FIX_K6 対応する半径方向歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_RATIONAL_MODEL 係数 k4, k5, k6 が有効になる。後方互換性を提供するため、キャリブレーション関数に有理モデルを使用させ、8個以上の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_THIN_PRISM_MODEL 係数 s1, s2, s3, s4 が有効になる。後方互換性を提供するため、キャリブレーション関数に薄プリズムモデルを使用させ、12個以上の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_FIX_S1_S2_S3_S4 薄プリズム歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_TILTED_MODEL 係数 tauX と tauY が有効になる。後方互換性を提供するため、キャリブレーション関数に傾斜センサモデルを使用させ、14個の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_FIX_TAUX_TAUY 傾斜センサモデルの係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        戻り値:
        the overall RMS re-projection error. The function estimates the intrinsic camera parameters and extrinsic parameters for each of the views. The algorithm is based on CITE: Zhang2000 and CITE: BouguetMCT . The coordinates of 3D object points and their corresponding 2D projections in each view must be specified. That may be achieved by using an object with known geometry and easily detectable feature points. Such an object is called a calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as a calibration rig (see REF: findChessboardCorners). Currently, initialization of intrinsic parameters (when REF: CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration patterns (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also be used as long as initial cameraMatrix is provided. The algorithm performs the following steps:
        • 初期内部パラメータを計算する (このオプションは平面キャリブレーションパターンに対してのみ利用可能)、または入力パラメータから読み取る。CALIB_FIX_K? のいくつかが指定されていない限り、歪み係数は初期値としてすべてゼロに設定される。
        • 内部パラメータがすでに既知であるかのように、初期カメラ姿勢を推定する。これは REF: solvePnP を用いて行われる。
        • グローバルなLevenberg-Marquardt最適化アルゴリズムを実行して再投影誤差、すなわち観測された特徴点 imagePoints と投影された(現在のカメラパラメータと姿勢の推定値を用いた)物体点 objectPoints との間の二乗距離の総和を最小化する。詳細は REF: projectPoints を参照。
        覚え書き: If you use a non-square (i.e. non-N-by-N) grid and REF: findChessboardCorners for calibration, and REF: calibrateCamera returns bad values (zero distortion coefficients, \(c_x\) and \(c_y\) very far from the image center, and/or large differences between \(f_x\) and \(f_y\) (ratios of 10:1 or more)), then you are probably using patternSize=cvSize(rows,cols) instead of using patternSize=cvSize(cols,rows) in REF: findChessboardCorners. 覚え書き: The function may throw exceptions, if unsupported combination of parameters is provided or the system is underconstrained. SEE: calibrateCameraRO, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort
      • calibrateCameraExtended

        public static double calibrateCameraExtended​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints,
                                                     Size imageSize,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs,
                                                     Mat stdDeviationsIntrinsics,
                                                     Mat stdDeviationsExtrinsics,
                                                     Mat perViewErrors)
        Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
        引数:
        objectPoints - 新しいインターフェースでは、これはキャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトルである(例: std::vector<std::vector<cv::Vec3f>>)。外側のベクトルはパターンビューの数と同じ数の要素を持つ。各ビューで同じキャリブレーションパターンが示され、それが完全に見えている場合、すべてのベクトルは同一になる。ただし、部分的に隠れたパターンや、ビューごとに異なるパターンを使用することも可能である。その場合、ベクトルは異なるものになる。点は3次元であるが、使用するキャリブレーションパターンが平面リグであれば、それらはすべてキャリブレーションパターンのXY座標平面上にある(したがってZ座標は0)。旧インターフェースでは、異なるビューからの物体点のすべてのベクトルが連結される。
        imagePoints - 新しいインターフェースでは、これはキャリブレーションパターン点の投影のベクトルのベクトルである(例: std::vector<std::vector<cv::Vec2f>>)。imagePoints.size() と objectPoints.size()、および各 i に対する imagePoints[i].size() と objectPoints[i].size() は、それぞれ等しくなければならない。旧インターフェースでは、異なるビューからの物体点のすべてのベクトルが連結される。
        imageSize - カメラ内部行列の初期化にのみ使用される画像のサイズ。
        cameraMatrix - 3x3浮動小数点のカメラ内部行列 \(\cameramatrix{A}\) の入出力。 REF: CALIB_USE_INTRINSIC_GUESS および/または REF: CALIB_FIX_ASPECT_RATIO、REF: CALIB_FIX_PRINCIPAL_POINT、REF: CALIB_FIX_FOCAL_LENGTH が指定されている場合、関数を呼び出す前に fx, fy, cx, cy の一部またはすべてを初期化しておく必要がある。
        distCoeffs - 歪み係数 \(\distcoeffs\) の入出力ベクトル。
        rvecs - 各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>>)。すなわち、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からカメラ座標空間への基底変換を行う。その双対性により、この組はカメラ座標空間に対するキャリブレーションパターンの位置と等価である。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。上記のパラメータ説明を参照。
        stdDeviationsIntrinsics - 内部パラメータについて推定された標準偏差の出力ベクトル。偏差値の順序: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) いずれかのパラメータが推定されない場合、その偏差は0となる。
        stdDeviationsExtrinsics - 外部パラメータについて推定された標準偏差の出力ベクトル。偏差値の順序: \((R_0, T_0, \dotsc , R_{M - 1}, T_{M - 1})\)。ここで M はパターンビューの数。 \(R_i, T_i\) は連結された1x3ベクトルである。
        perViewErrors - Output vector of the RMS re-projection error estimated for each pattern view.
        • REF: CALIB_USE_INTRINSIC_GUESS cameraMatrix には、さらに最適化される fx, fy, cx, cy の有効な初期値が含まれている。そうでない場合、(cx, cy) は初期状態で画像中心に設定され(imageSize が使用される)、焦点距離は最小二乗法で計算される。なお、内部パラメータが既知であれば、外部パラメータを推定するためだけにこの関数を使う必要はない。代わりに REF: solvePnP を使用すること。
        • REF: CALIB_FIX_PRINCIPAL_POINT 主点はグローバル最適化の間変更されない。中心、または REF: CALIB_USE_INTRINSIC_GUESS も設定されている場合に指定された別の位置にとどまる。
        • REF: CALIB_FIX_ASPECT_RATIO 関数は fy のみを自由パラメータとみなす。比 fx/fy は入力 cameraMatrix と同じままにされる。 REF: CALIB_USE_INTRINSIC_GUESS が設定されていない場合、fx と fy の実際の入力値は無視され、それらの比のみが計算されて以降使用される。
        • REF: CALIB_ZERO_TANGENT_DIST 接線歪み係数 \((p_1, p_2)\) はゼロに設定され、ゼロのままにされる。
        • REF: CALIB_FIX_FOCAL_LENGTH REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、焦点距離はグローバル最適化の間変更されない。
        • REF: CALIB_FIX_K1,..., REF: CALIB_FIX_K6 対応する半径方向歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_RATIONAL_MODEL 係数 k4, k5, k6 が有効になる。後方互換性を提供するため、キャリブレーション関数に有理モデルを使用させ、8個以上の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_THIN_PRISM_MODEL 係数 s1, s2, s3, s4 が有効になる。後方互換性を提供するため、キャリブレーション関数に薄プリズムモデルを使用させ、12個以上の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_FIX_S1_S2_S3_S4 薄プリズム歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_TILTED_MODEL 係数 tauX と tauY が有効になる。後方互換性を提供するため、キャリブレーション関数に傾斜センサモデルを使用させ、14個の係数を返させるには、この追加フラグを明示的に指定する必要がある。
        • REF: CALIB_FIX_TAUX_TAUY 傾斜センサモデルの係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        戻り値:
        the overall RMS re-projection error. The function estimates the intrinsic camera parameters and extrinsic parameters for each of the views. The algorithm is based on CITE: Zhang2000 and CITE: BouguetMCT . The coordinates of 3D object points and their corresponding 2D projections in each view must be specified. That may be achieved by using an object with known geometry and easily detectable feature points. Such an object is called a calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as a calibration rig (see REF: findChessboardCorners). Currently, initialization of intrinsic parameters (when REF: CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration patterns (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also be used as long as initial cameraMatrix is provided. The algorithm performs the following steps:
        • 初期内部パラメータを計算する (このオプションは平面キャリブレーションパターンに対してのみ利用可能)、または入力パラメータから読み取る。CALIB_FIX_K? のいくつかが指定されていない限り、歪み係数は初期値としてすべてゼロに設定される。
        • 内部パラメータがすでに既知であるかのように、初期カメラ姿勢を推定する。これは REF: solvePnP を用いて行われる。
        • グローバルなLevenberg-Marquardt最適化アルゴリズムを実行して再投影誤差、すなわち観測された特徴点 imagePoints と投影された(現在のカメラパラメータと姿勢の推定値を用いた)物体点 objectPoints との間の二乗距離の総和を最小化する。詳細は REF: projectPoints を参照。
        覚え書き: If you use a non-square (i.e. non-N-by-N) grid and REF: findChessboardCorners for calibration, and REF: calibrateCamera returns bad values (zero distortion coefficients, \(c_x\) and \(c_y\) very far from the image center, and/or large differences between \(f_x\) and \(f_y\) (ratios of 10:1 or more)), then you are probably using patternSize=cvSize(rows,cols) instead of using patternSize=cvSize(cols,rows) in REF: findChessboardCorners. 覚え書き: The function may throw exceptions, if unsupported combination of parameters is provided or the system is underconstrained. SEE: calibrateCameraRO, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort
      • calibrateCamera

        public static double calibrateCamera​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints,
                                             Size imageSize,
                                             Mat cameraMatrix,
                                             Mat distCoeffs,
                                             java.util.List<Mat> rvecs,
                                             java.util.List<Mat> tvecs,
                                             int flags,
                                             TermCriteria criteria)
      • calibrateCamera

        public static double calibrateCamera​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints,
                                             Size imageSize,
                                             Mat cameraMatrix,
                                             Mat distCoeffs,
                                             java.util.List<Mat> rvecs,
                                             java.util.List<Mat> tvecs,
                                             int flags)
      • calibrateCamera

        public static double calibrateCamera​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints,
                                             Size imageSize,
                                             Mat cameraMatrix,
                                             Mat distCoeffs,
                                             java.util.List<Mat> rvecs,
                                             java.util.List<Mat> tvecs)
      • calibrateCameraROExtended

        public static double calibrateCameraROExtended​(java.util.List<Mat> objectPoints,
                                                       java.util.List<Mat> imagePoints,
                                                       Size imageSize,
                                                       int iFixedPoint,
                                                       Mat cameraMatrix,
                                                       Mat distCoeffs,
                                                       java.util.List<Mat> rvecs,
                                                       java.util.List<Mat> tvecs,
                                                       Mat newObjPoints,
                                                       Mat stdDeviationsIntrinsics,
                                                       Mat stdDeviationsExtrinsics,
                                                       Mat stdDeviationsObjPoints,
                                                       Mat perViewErrors,
                                                       int flags,
                                                       TermCriteria criteria)
        Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern. This function is an extension of #calibrateCamera with the method of releasing object which was proposed in CITE: strobl2011iccv. In many common cases with inaccurate, unmeasured, roughly planar targets (calibration plates), this method can dramatically improve the precision of the estimated camera parameters. Both the object-releasing method and standard method are supported by this function. Use the parameter iFixedPoint for method selection. In the internal implementation, #calibrateCamera is a wrapper for this function.
        引数:
        objectPoints - キャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトル。詳細は #calibrateCamera を参照。物体解放法(object releasing method)を使用する場合、各ビューで同一のキャリブレーションボードを使用し、それが完全に見えていなければならず、すべての objectPoints[i] が同一で、すべての点がおおむね平面に近くなければならない。キャリブレーションターゲットは剛体でなければならない。少なくとも、画像取得のために(キャリブレーションターゲットではなく)カメラを移動させる場合は静止していなければならない。
        imagePoints - キャリブレーションパターン点の投影のベクトルのベクトル。詳細は #calibrateCamera を参照。
        imageSize - 内部カメラ行列を初期化するためだけに使用される画像のサイズ。
        iFixedPoint - 固定する objectPoints[0] 内の3D物体点のインデックス。これはキャリブレーション手法の選択スイッチとしても機能する。物体解放法を使用する場合は [1, objectPoints[0].size()-2] の範囲でパラメータを渡し、そうでない場合はこの範囲外の値を渡すと標準キャリブレーション手法が選択される。通常、物体解放法を利用する場合はキャリブレーションボードグリッドの右上隅の点を固定することが推奨される。 \cite strobl2011iccv によれば、他の2点も固定される。この実装では、objectPoints[0].front と objectPoints[0].back.z が使用される。物体解放法では、これら3つの固定点の座標が十分に正確である場合にのみ、正確な rvecs、tvecs、newObjPoints が得られる。
        cameraMatrix - 3x3浮動小数点のカメラ行列の出力。詳細は #calibrateCamera を参照。
        distCoeffs - 歪み係数の出力ベクトル。詳細は #calibrateCamera を参照。
        rvecs - 各パターンビューについて推定された回転ベクトルの出力ベクトル。詳細は #calibrateCamera を参照。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。
        newObjPoints - キャリブレーションパターン点の更新された出力ベクトル。座標は3つの固定点に基づいてスケーリングされる場合がある。返される座標は、上記の3つの固定点が正確である場合にのみ正確である。不要であれば noArray() を渡せる。このパラメータは標準キャリブレーション手法では無視される。
        stdDeviationsIntrinsics - 内部パラメータについて推定された標準偏差の出力ベクトル。詳細は #calibrateCamera を参照。
        stdDeviationsExtrinsics - 外部パラメータについて推定された標準偏差の出力ベクトル。詳細は #calibrateCamera を参照。
        stdDeviationsObjPoints - 精緻化されたキャリブレーションパターン点の座標について推定された標準偏差の出力ベクトル。objectPoints[0] ベクトルと同じサイズおよび順序を持つ。このパラメータは標準キャリブレーション手法では無視される。
        perViewErrors - 各パターンビューについて推定されたRMS再投影誤差の出力ベクトル。
        flags - ゼロまたはいくつかの定義済み値の組み合わせとなりうる各種フラグ。詳細は #calibrateCamera を参照。物体解放法を使用する場合、キャリブレーション時間が大幅に長くなることがある。 CALIB_USE_QR または CALIB_USE_LU を使用すると高速にキャリブレーションできるが、まれに精度が低く安定性に欠ける可能性がある。
        criteria - 反復最適化アルゴリズムの終了条件。
        戻り値:
        全体のRMS再投影誤差。この関数は、内部カメラパラメータと各ビューの外部パラメータを推定する。アルゴリズムは CITE: Zhang2000、CITE: BouguetMCT、CITE: strobl2011iccv に基づく。その他の詳細な説明は #calibrateCamera を参照。SEE: calibrateCamera, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort
      • calibrateCameraROExtended

        public static double calibrateCameraROExtended​(java.util.List<Mat> objectPoints,
                                                       java.util.List<Mat> imagePoints,
                                                       Size imageSize,
                                                       int iFixedPoint,
                                                       Mat cameraMatrix,
                                                       Mat distCoeffs,
                                                       java.util.List<Mat> rvecs,
                                                       java.util.List<Mat> tvecs,
                                                       Mat newObjPoints,
                                                       Mat stdDeviationsIntrinsics,
                                                       Mat stdDeviationsExtrinsics,
                                                       Mat stdDeviationsObjPoints,
                                                       Mat perViewErrors,
                                                       int flags)
        Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern. This function is an extension of #calibrateCamera with the method of releasing object which was proposed in CITE: strobl2011iccv. In many common cases with inaccurate, unmeasured, roughly planar targets (calibration plates), this method can dramatically improve the precision of the estimated camera parameters. Both the object-releasing method and standard method are supported by this function. Use the parameter iFixedPoint for method selection. In the internal implementation, #calibrateCamera is a wrapper for this function.
        引数:
        objectPoints - キャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトル。詳細は #calibrateCamera を参照。物体解放法(object releasing method)を使用する場合、各ビューで同一のキャリブレーションボードを使用し、それが完全に見えていなければならず、すべての objectPoints[i] が同一で、すべての点がおおむね平面に近くなければならない。キャリブレーションターゲットは剛体でなければならない。少なくとも、画像取得のために(キャリブレーションターゲットではなく)カメラを移動させる場合は静止していなければならない。
        imagePoints - キャリブレーションパターン点の投影のベクトルのベクトル。詳細は #calibrateCamera を参照。
        imageSize - 内部カメラ行列を初期化するためだけに使用される画像のサイズ。
        iFixedPoint - 固定する objectPoints[0] 内の3D物体点のインデックス。これはキャリブレーション手法の選択スイッチとしても機能する。物体解放法を使用する場合は [1, objectPoints[0].size()-2] の範囲でパラメータを渡し、そうでない場合はこの範囲外の値を渡すと標準キャリブレーション手法が選択される。通常、物体解放法を利用する場合はキャリブレーションボードグリッドの右上隅の点を固定することが推奨される。 \cite strobl2011iccv によれば、他の2点も固定される。この実装では、objectPoints[0].front と objectPoints[0].back.z が使用される。物体解放法では、これら3つの固定点の座標が十分に正確である場合にのみ、正確な rvecs、tvecs、newObjPoints が得られる。
        cameraMatrix - 3x3浮動小数点のカメラ行列の出力。詳細は #calibrateCamera を参照。
        distCoeffs - 歪み係数の出力ベクトル。詳細は #calibrateCamera を参照。
        rvecs - 各パターンビューについて推定された回転ベクトルの出力ベクトル。詳細は #calibrateCamera を参照。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。
        newObjPoints - キャリブレーションパターン点の更新された出力ベクトル。座標は3つの固定点に基づいてスケーリングされる場合がある。返される座標は、上記の3つの固定点が正確である場合にのみ正確である。不要であれば noArray() を渡せる。このパラメータは標準キャリブレーション手法では無視される。
        stdDeviationsIntrinsics - 内部パラメータについて推定された標準偏差の出力ベクトル。詳細は #calibrateCamera を参照。
        stdDeviationsExtrinsics - 外部パラメータについて推定された標準偏差の出力ベクトル。詳細は #calibrateCamera を参照。
        stdDeviationsObjPoints - 精緻化されたキャリブレーションパターン点の座標について推定された標準偏差の出力ベクトル。objectPoints[0] ベクトルと同じサイズおよび順序を持つ。このパラメータは標準キャリブレーション手法では無視される。
        perViewErrors - 各パターンビューについて推定されたRMS再投影誤差の出力ベクトル。
        flags - ゼロまたはいくつかの定義済み値の組み合わせとなりうる各種フラグ。詳細は #calibrateCamera を参照。物体解放法を使用する場合、キャリブレーション時間が大幅に長くなることがある。 CALIB_USE_QR または CALIB_USE_LU を使用すると高速にキャリブレーションできるが、まれに精度が低く安定性に欠ける可能性がある。
        戻り値:
        全体のRMS再投影誤差。この関数は、内部カメラパラメータと各ビューの外部パラメータを推定する。アルゴリズムは CITE: Zhang2000、CITE: BouguetMCT、CITE: strobl2011iccv に基づく。その他の詳細な説明は #calibrateCamera を参照。SEE: calibrateCamera, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort
      • calibrateCameraROExtended

        public static double calibrateCameraROExtended​(java.util.List<Mat> objectPoints,
                                                       java.util.List<Mat> imagePoints,
                                                       Size imageSize,
                                                       int iFixedPoint,
                                                       Mat cameraMatrix,
                                                       Mat distCoeffs,
                                                       java.util.List<Mat> rvecs,
                                                       java.util.List<Mat> tvecs,
                                                       Mat newObjPoints,
                                                       Mat stdDeviationsIntrinsics,
                                                       Mat stdDeviationsExtrinsics,
                                                       Mat stdDeviationsObjPoints,
                                                       Mat perViewErrors)
        Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern. This function is an extension of #calibrateCamera with the method of releasing object which was proposed in CITE: strobl2011iccv. In many common cases with inaccurate, unmeasured, roughly planar targets (calibration plates), this method can dramatically improve the precision of the estimated camera parameters. Both the object-releasing method and standard method are supported by this function. Use the parameter iFixedPoint for method selection. In the internal implementation, #calibrateCamera is a wrapper for this function.
        引数:
        objectPoints - キャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトル。詳細は #calibrateCamera を参照。物体解放法(object releasing method)を使用する場合、各ビューで同一のキャリブレーションボードを使用し、それが完全に見えていなければならず、すべての objectPoints[i] が同一で、すべての点がおおむね平面に近くなければならない。キャリブレーションターゲットは剛体でなければならない。少なくとも、画像取得のために(キャリブレーションターゲットではなく)カメラを移動させる場合は静止していなければならない。
        imagePoints - キャリブレーションパターン点の投影のベクトルのベクトル。詳細は #calibrateCamera を参照。
        imageSize - 内部カメラ行列を初期化するためだけに使用される画像のサイズ。
        iFixedPoint - 固定する objectPoints[0] 内の3D物体点のインデックス。これはキャリブレーション手法の選択スイッチとしても機能する。物体解放法を使用する場合は [1, objectPoints[0].size()-2] の範囲でパラメータを渡し、そうでない場合はこの範囲外の値を渡すと標準キャリブレーション手法が選択される。通常、物体解放法を利用する場合はキャリブレーションボードグリッドの右上隅の点を固定することが推奨される。 \cite strobl2011iccv によれば、他の2点も固定される。この実装では、objectPoints[0].front と objectPoints[0].back.z が使用される。物体解放法では、これら3つの固定点の座標が十分に正確である場合にのみ、正確な rvecs、tvecs、newObjPoints が得られる。
        cameraMatrix - 3x3浮動小数点のカメラ行列の出力。詳細は #calibrateCamera を参照。
        distCoeffs - 歪み係数の出力ベクトル。詳細は #calibrateCamera を参照。
        rvecs - 各パターンビューについて推定された回転ベクトルの出力ベクトル。詳細は #calibrateCamera を参照。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。
        newObjPoints - キャリブレーションパターン点の更新された出力ベクトル。座標は3つの固定点に基づいてスケーリングされる場合がある。返される座標は、上記の3つの固定点が正確である場合にのみ正確である。不要であれば noArray() を渡せる。このパラメータは標準キャリブレーション手法では無視される。
        stdDeviationsIntrinsics - 内部パラメータについて推定された標準偏差の出力ベクトル。詳細は #calibrateCamera を参照。
        stdDeviationsExtrinsics - 外部パラメータについて推定された標準偏差の出力ベクトル。詳細は #calibrateCamera を参照。
        stdDeviationsObjPoints - 精緻化されたキャリブレーションパターン点の座標について推定された標準偏差の出力ベクトル。objectPoints[0] ベクトルと同じサイズおよび順序を持つ。このパラメータは標準キャリブレーション手法では無視される。
        perViewErrors - 各パターンビューについて推定されたRMS再投影誤差の出力ベクトル。詳細は #calibrateCamera を参照。物体解放法を使用する場合、キャリブレーション時間が大幅に長くなることがある。 CALIB_USE_QR または CALIB_USE_LU を使用すると高速にキャリブレーションできるが、まれに精度が低く安定性に欠ける可能性がある。
        戻り値:
        全体のRMS再投影誤差。この関数は、内部カメラパラメータと各ビューの外部パラメータを推定する。アルゴリズムは CITE: Zhang2000、CITE: BouguetMCT、CITE: strobl2011iccv に基づく。その他の詳細な説明は #calibrateCamera を参照。SEE: calibrateCamera, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort
      • calibrateCameraRO

        public static double calibrateCameraRO​(java.util.List<Mat> objectPoints,
                                               java.util.List<Mat> imagePoints,
                                               Size imageSize,
                                               int iFixedPoint,
                                               Mat cameraMatrix,
                                               Mat distCoeffs,
                                               java.util.List<Mat> rvecs,
                                               java.util.List<Mat> tvecs,
                                               Mat newObjPoints,
                                               int flags,
                                               TermCriteria criteria)
      • calibrateCameraRO

        public static double calibrateCameraRO​(java.util.List<Mat> objectPoints,
                                               java.util.List<Mat> imagePoints,
                                               Size imageSize,
                                               int iFixedPoint,
                                               Mat cameraMatrix,
                                               Mat distCoeffs,
                                               java.util.List<Mat> rvecs,
                                               java.util.List<Mat> tvecs,
                                               Mat newObjPoints,
                                               int flags)
      • calibrateCameraRO

        public static double calibrateCameraRO​(java.util.List<Mat> objectPoints,
                                               java.util.List<Mat> imagePoints,
                                               Size imageSize,
                                               int iFixedPoint,
                                               Mat cameraMatrix,
                                               Mat distCoeffs,
                                               java.util.List<Mat> rvecs,
                                               java.util.List<Mat> tvecs,
                                               Mat newObjPoints)
      • calibrationMatrixValues

        public static void calibrationMatrixValues​(Mat cameraMatrix,
                                                   Size imageSize,
                                                   double apertureWidth,
                                                   double apertureHeight,
                                                   double[] fovx,
                                                   double[] fovy,
                                                   double[] focalLength,
                                                   Point principalPoint,
                                                   double[] aspectRatio)
        Computes useful camera characteristics from the camera intrinsic matrix.
        引数:
        cameraMatrix - #calibrateCamera または #stereoCalibrate で推定可能なカメラ内部行列の入力。
        imageSize - ピクセル単位の入力画像サイズ。
        apertureWidth - センサの物理的な幅(mm)。
        apertureHeight - センサの物理的な高さ(mm)。
        fovx - センサの水平軸に沿った視野角(度)の出力。
        fovy - センサの垂直軸に沿った視野角(度)の出力。
        focalLength - レンズの焦点距離(mm)。
        principalPoint - 主点(mm)。
        aspectRatio - \(f_y/f_x\) この関数は、以前に推定されたカメラ行列からさまざまな有用なカメラ特性を計算する。注: 単位 'mm' は、チェスボードのピッチに対して選んだ任意の測定単位を表すことに留意すること(したがって任意の値でよい)。
      • stereoCalibrateExtended

        public static double stereoCalibrateExtended​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat cameraMatrix1,
                                                     Mat distCoeffs1,
                                                     Mat cameraMatrix2,
                                                     Mat distCoeffs2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T,
                                                     Mat E,
                                                     Mat F,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs,
                                                     Mat perViewErrors,
                                                     int flags,
                                                     TermCriteria criteria)
        Calibrates a stereo camera set up. This function finds the intrinsic parameters for each of the two cameras and the extrinsic parameters between the two cameras.
        引数:
        objectPoints - キャリブレーションパターン点のベクトルのベクトル。REF: calibrateCamera と同じ構造。各パターンビューについて、両方のカメラが同じ物体点を見る必要がある。したがって、objectPoints.size()、imagePoints1.size()、imagePoints2.size() は等しくなければならず、また各 i に対して objectPoints[i].size()、imagePoints1[i].size()、imagePoints2[i].size() も等しくなければならない。
        imagePoints1 - 1台目のカメラで観測されたキャリブレーションパターン点の投影のベクトルのベクトル。REF: calibrateCamera と同じ構造。
        imagePoints2 - 2台目のカメラで観測されたキャリブレーションパターン点の投影のベクトルのベクトル。REF: calibrateCamera と同じ構造。
        cameraMatrix1 - 1台目のカメラの入出力カメラ内部行列。REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(下記参照)。
        distCoeffs1 - 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。
        cameraMatrix2 - 2台目のカメラの入出力カメラ内部行列。cameraMatrix1 の説明を参照。
        distCoeffs2 - 2台目のカメラのレンズ歪み係数の入出力。distCoeffs1 の説明を参照。
        imageSize - カメラ内部行列の初期化にのみ使用される画像のサイズ。
        R - 出力回転行列。並進ベクトル T とともに、この行列は1台目のカメラの座標系で与えられた点を2台目のカメラの座標系の点に移す。より技術的に言えば、R と T の組は1台目のカメラの座標系から2台目のカメラの座標系への基底変換を行う。その双対性により、この組は2台目のカメラ座標系に対する1台目のカメラの位置と等価である。
        T - 出力並進ベクトル。上記の説明を参照。
        E - 出力基本行列(essential matrix)。
        F - 出力基礎行列(fundamental matrix)。
        rvecs - ステレオペアの1台目のカメラの座標系において、各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>)。より詳しくは、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からステレオペアの1台目のカメラのカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からステレオペアの1台目のカメラのカメラ座標空間への基底変換を行う。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。前の出力パラメータ(rvecs)のパラメータ説明を参照。
        perViewErrors - 各パターンビューについて推定されたRMS再投影誤差の出力ベクトル。
        flags - Different flags that may be zero or a combination of the following values:
        • REF: CALIB_FIX_INTRINSIC cameraMatrix? と distCoeffs? を固定し、R, T, E, F の行列のみが推定されるようにする。
        • REF: CALIB_USE_INTRINSIC_GUESS 指定されたフラグに従って内部パラメータの一部またはすべてを最適化する。初期値はユーザが提供する。
        • REF: CALIB_USE_EXTRINSIC_GUESS R と T に、さらに最適化される有効な初期値が含まれている。そうでない場合、R と T はパターンビューの中央値(各次元を別々に)に初期化される。
        • REF: CALIB_FIX_PRINCIPAL_POINT 最適化の間、主点を固定する。
        • REF: CALIB_FIX_FOCAL_LENGTH \(f^{(j)}_x\) と \(f^{(j)}_y\) を固定する。
        • REF: CALIB_FIX_ASPECT_RATIO \(f^{(j)}_y\) を最適化する。比 \(f^{(j)}_x/f^{(j)}_y\) を固定する。
        • REF: CALIB_SAME_FOCAL_LENGTH \(f^{(0)}_x=f^{(1)}_x\) と \(f^{(0)}_y=f^{(1)}_y\) を強制する。
        • REF: CALIB_ZERO_TANGENT_DIST 各カメラの接線方向の歪み係数を0に設定し、その値で固定する。
        • REF: CALIB_FIX_K1,..., REF: CALIB_FIX_K6 最適化の際に対応する放射方向の歪み係数を変更しない。REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合は、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_RATIONAL_MODEL 係数 k4、k5、k6 を有効にする。後方互換性を保つため、キャリブレーション関数に有理モデルを使用させ8個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_THIN_PRISM_MODEL 係数 s1、s2、s3、s4 を有効にする。後方互換性を保つため、キャリブレーション関数に薄プリズムモデルを使用させ12個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_FIX_S1_S2_S3_S4 薄プリズム歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_TILTED_MODEL 係数 tauX と tauY を有効にする。後方互換性を保つため、キャリブレーション関数に傾斜センサモデルを使用させ14個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_FIX_TAUX_TAUY 傾斜センサモデルの係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        criteria - 反復最適化アルゴリズムの終了条件。この関数はステレオペアを構成する2台のカメラ間の変換を推定する。相対的な位置と姿勢が固定されたステレオカメラにおいて、ある物体の第1カメラに対する姿勢と第2カメラに対する姿勢をそれぞれ ( \(R_1\),\(T_1\) ) と (\(R_2\),\(T_2\)) として計算したとすると、これらの姿勢は必ず互いに関係している。これは、2台のカメラ間の相対的な位置と姿勢 (\(R\),\(T\)) が既知であれば、(\(R_1\),\(T_1\)) が与えられたときに (\(R_2\),\(T_2\)) を計算できることを意味する。これがこの関数の行う処理である。次を満たす (\(R\),\(T\)) を計算する: \(R_2=R R_1\) \(T_2=R T_1 + T.\) したがって、第1カメラの座標系における3D点の座標表現が与えられたとき、その点の第2カメラの座標系における座標表現を計算できる: \(\begin{bmatrix} X_2 \\ Y_2 \\ Z_2 \\ 1 \end{bmatrix} = \begin{bmatrix} R & T \\ 0 & 1 \end{bmatrix} \begin{bmatrix} X_1 \\ Y_1 \\ Z_1 \\ 1 \end{bmatrix}.\) 必要に応じて、本質行列 E を計算する: \(E= \vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} R\) ここで \(T_i\) は並進ベクトル \(T\) の成分である: \(T=[T_0, T_1, T_2]^T\) 。さらに、この関数は基礎行列 F も計算できる: \(F = cameraMatrix2^{-T}\cdot E \cdot cameraMatrix1^{-1}\) ステレオ関連の情報のほかに、この関数は2台のカメラそれぞれのフルキャリブレーションも実行できる。ただし、パラメータ空間の次元が高く、入力データにノイズが含まれるため、関数が正しい解から発散することがある。各カメラの内部パラメータを個別に(たとえば #calibrateCamera を使用して)高精度に推定できる場合は、そうしてから計算した内部パラメータとともに REF: CALIB_FIX_INTRINSIC フラグを関数に渡すことが推奨される。そうでない場合、すべてのパラメータを一度に推定するなら、いくつかのパラメータを制限するのが妥当である。たとえば REF: CALIB_SAME_FOCAL_LENGTH と REF: CALIB_ZERO_TANGENT_DIST フラグを渡すことで、これは通常妥当な仮定である。#calibrateCamera と同様に、この関数は両カメラの利用可能なすべてのビューのすべての点について、再投影誤差の合計を最小化する。関数は再投影誤差の最終的な値を返す。
        戻り値:
        自動生成
      • stereoCalibrateExtended

        public static double stereoCalibrateExtended​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat cameraMatrix1,
                                                     Mat distCoeffs1,
                                                     Mat cameraMatrix2,
                                                     Mat distCoeffs2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T,
                                                     Mat E,
                                                     Mat F,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs,
                                                     Mat perViewErrors,
                                                     int flags)
        Calibrates a stereo camera set up. This function finds the intrinsic parameters for each of the two cameras and the extrinsic parameters between the two cameras.
        引数:
        objectPoints - キャリブレーションパターン点のベクトルのベクトル。REF: calibrateCamera と同じ構造。各パターンビューについて、両方のカメラが同じ物体点を見る必要がある。したがって、objectPoints.size()、imagePoints1.size()、imagePoints2.size() は等しくなければならず、また各 i に対して objectPoints[i].size()、imagePoints1[i].size()、imagePoints2[i].size() も等しくなければならない。
        imagePoints1 - 1台目のカメラで観測されたキャリブレーションパターン点の投影のベクトルのベクトル。REF: calibrateCamera と同じ構造。
        imagePoints2 - 2台目のカメラで観測されたキャリブレーションパターン点の投影のベクトルのベクトル。REF: calibrateCamera と同じ構造。
        cameraMatrix1 - 1台目のカメラの入出力カメラ内部行列。REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(下記参照)。
        distCoeffs1 - 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。
        cameraMatrix2 - 2台目のカメラの入出力カメラ内部行列。cameraMatrix1 の説明を参照。
        distCoeffs2 - 2台目のカメラのレンズ歪み係数の入出力。distCoeffs1 の説明を参照。
        imageSize - カメラ内部行列の初期化にのみ使用される画像のサイズ。
        R - 出力回転行列。並進ベクトル T とともに、この行列は1台目のカメラの座標系で与えられた点を2台目のカメラの座標系の点に移す。より技術的に言えば、R と T の組は1台目のカメラの座標系から2台目のカメラの座標系への基底変換を行う。その双対性により、この組は2台目のカメラ座標系に対する1台目のカメラの位置と等価である。
        T - 出力並進ベクトル。上記の説明を参照。
        E - 出力基本行列(essential matrix)。
        F - 出力基礎行列(fundamental matrix)。
        rvecs - ステレオペアの1台目のカメラの座標系において、各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>)。より詳しくは、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からステレオペアの1台目のカメラのカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からステレオペアの1台目のカメラのカメラ座標空間への基底変換を行う。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。前の出力パラメータ(rvecs)のパラメータ説明を参照。
        perViewErrors - 各パターンビューについて推定されたRMS再投影誤差の出力ベクトル。
        flags - Different flags that may be zero or a combination of the following values:
        • REF: CALIB_FIX_INTRINSIC cameraMatrix? と distCoeffs? を固定し、R, T, E, F の行列のみが推定されるようにする。
        • REF: CALIB_USE_INTRINSIC_GUESS 指定されたフラグに従って内部パラメータの一部またはすべてを最適化する。初期値はユーザが提供する。
        • REF: CALIB_USE_EXTRINSIC_GUESS R と T に、さらに最適化される有効な初期値が含まれている。そうでない場合、R と T はパターンビューの中央値(各次元を別々に)に初期化される。
        • REF: CALIB_FIX_PRINCIPAL_POINT 最適化の間、主点を固定する。
        • REF: CALIB_FIX_FOCAL_LENGTH \(f^{(j)}_x\) と \(f^{(j)}_y\) を固定する。
        • REF: CALIB_FIX_ASPECT_RATIO \(f^{(j)}_y\) を最適化する。比 \(f^{(j)}_x/f^{(j)}_y\) を固定する。
        • REF: CALIB_SAME_FOCAL_LENGTH \(f^{(0)}_x=f^{(1)}_x\) と \(f^{(0)}_y=f^{(1)}_y\) を強制する。
        • REF: CALIB_ZERO_TANGENT_DIST 各カメラの接線方向の歪み係数を0に設定し、その値で固定する。
        • REF: CALIB_FIX_K1,..., REF: CALIB_FIX_K6 最適化の際に対応する放射方向の歪み係数を変更しない。REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合は、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_RATIONAL_MODEL 係数 k4、k5、k6 を有効にする。後方互換性を保つため、キャリブレーション関数に有理モデルを使用させ8個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_THIN_PRISM_MODEL 係数 s1、s2、s3、s4 を有効にする。後方互換性を保つため、キャリブレーション関数に薄プリズムモデルを使用させ12個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_FIX_S1_S2_S3_S4 薄プリズム歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_TILTED_MODEL 係数 tauX と tauY を有効にする。後方互換性を保つため、キャリブレーション関数に傾斜センサモデルを使用させ14個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_FIX_TAUX_TAUY 傾斜センサモデルの係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        The function estimates the transformation between two cameras making a stereo pair. If one computes the poses of an object relative to the first camera and to the second camera, ( \(R_1\),\(T_1\) ) and (\(R_2\),\(T_2\)), respectively, for a stereo camera where the relative position and orientation between the two cameras are fixed, then those poses definitely relate to each other. This means, if the relative position and orientation (\(R\),\(T\)) of the two cameras is known, it is possible to compute (\(R_2\),\(T_2\)) when (\(R_1\),\(T_1\)) is given. This is what the described function does. It computes (\(R\),\(T\)) such that: \(R_2=R R_1\) \(T_2=R T_1 + T.\) Therefore, one can compute the coordinate representation of a 3D point for the second camera's coordinate system when given the point's coordinate representation in the first camera's coordinate system: \(\begin{bmatrix} X_2 \\ Y_2 \\ Z_2 \\ 1 \end{bmatrix} = \begin{bmatrix} R & T \\ 0 & 1 \end{bmatrix} \begin{bmatrix} X_1 \\ Y_1 \\ Z_1 \\ 1 \end{bmatrix}.\) Optionally, it computes the essential matrix E: \(E= \vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} R\) where \(T_i\) are components of the translation vector \(T\) : \(T=[T_0, T_1, T_2]^T\) . And the function can also compute the fundamental matrix F: \(F = cameraMatrix2^{-T}\cdot E \cdot cameraMatrix1^{-1}\) Besides the stereo-related information, the function can also perform a full calibration of each of the two cameras. However, due to the high dimensionality of the parameter space and noise in the input data, the function can diverge from the correct solution. If the intrinsic parameters can be estimated with high accuracy for each of the cameras individually (for example, using #calibrateCamera ), you are recommended to do so and then pass REF: CALIB_FIX_INTRINSIC flag to the function along with the computed intrinsic parameters. Otherwise, if all the parameters are estimated at once, it makes sense to restrict some parameters, for example, pass REF: CALIB_SAME_FOCAL_LENGTH and REF: CALIB_ZERO_TANGENT_DIST flags, which is usually a reasonable assumption. Similarly to #calibrateCamera, the function minimizes the total re-projection error for all the points in all the available views from both cameras. The function returns the final value of the re-projection error.
        戻り値:
        自動生成
      • stereoCalibrateExtended

        public static double stereoCalibrateExtended​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat cameraMatrix1,
                                                     Mat distCoeffs1,
                                                     Mat cameraMatrix2,
                                                     Mat distCoeffs2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T,
                                                     Mat E,
                                                     Mat F,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs,
                                                     Mat perViewErrors)
        Calibrates a stereo camera set up. This function finds the intrinsic parameters for each of the two cameras and the extrinsic parameters between the two cameras.
        引数:
        objectPoints - キャリブレーションパターン点のベクトルのベクトル。REF: calibrateCamera と同じ構造。各パターンビューについて、両方のカメラが同じ物体点を見る必要がある。したがって、objectPoints.size()、imagePoints1.size()、imagePoints2.size() は等しくなければならず、また各 i に対して objectPoints[i].size()、imagePoints1[i].size()、imagePoints2[i].size() も等しくなければならない。
        imagePoints1 - 1台目のカメラで観測されたキャリブレーションパターン点の投影のベクトルのベクトル。REF: calibrateCamera と同じ構造。
        imagePoints2 - 2台目のカメラで観測されたキャリブレーションパターン点の投影のベクトルのベクトル。REF: calibrateCamera と同じ構造。
        cameraMatrix1 - 1台目のカメラの入出力カメラ内部行列。REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(下記参照)。
        distCoeffs1 - 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。
        cameraMatrix2 - 2台目のカメラの入出力カメラ内部行列。cameraMatrix1 の説明を参照。
        distCoeffs2 - 2台目のカメラのレンズ歪み係数の入出力。distCoeffs1 の説明を参照。
        imageSize - カメラ内部行列の初期化にのみ使用される画像のサイズ。
        R - 出力回転行列。並進ベクトル T とともに、この行列は1台目のカメラの座標系で与えられた点を2台目のカメラの座標系の点に移す。より技術的に言えば、R と T の組は1台目のカメラの座標系から2台目のカメラの座標系への基底変換を行う。その双対性により、この組は2台目のカメラ座標系に対する1台目のカメラの位置と等価である。
        T - 出力並進ベクトル。上記の説明を参照。
        E - 出力基本行列(essential matrix)。
        F - 出力基礎行列(fundamental matrix)。
        rvecs - ステレオペアの1台目のカメラの座標系において、各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>)。より詳しくは、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からステレオペアの1台目のカメラのカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からステレオペアの1台目のカメラのカメラ座標空間への基底変換を行う。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。前の出力パラメータ(rvecs)のパラメータ説明を参照。
        perViewErrors - Output vector of the RMS re-projection error estimated for each pattern view.
        • REF: CALIB_FIX_INTRINSIC cameraMatrix? と distCoeffs? を固定し、R, T, E, F の行列のみが推定されるようにする。
        • REF: CALIB_USE_INTRINSIC_GUESS 指定されたフラグに従って内部パラメータの一部またはすべてを最適化する。初期値はユーザが提供する。
        • REF: CALIB_USE_EXTRINSIC_GUESS R と T に、さらに最適化される有効な初期値が含まれている。そうでない場合、R と T はパターンビューの中央値(各次元を別々に)に初期化される。
        • REF: CALIB_FIX_PRINCIPAL_POINT 最適化の間、主点を固定する。
        • REF: CALIB_FIX_FOCAL_LENGTH \(f^{(j)}_x\) と \(f^{(j)}_y\) を固定する。
        • REF: CALIB_FIX_ASPECT_RATIO \(f^{(j)}_y\) を最適化する。比 \(f^{(j)}_x/f^{(j)}_y\) を固定する。
        • REF: CALIB_SAME_FOCAL_LENGTH \(f^{(0)}_x=f^{(1)}_x\) と \(f^{(0)}_y=f^{(1)}_y\) を強制する。
        • REF: CALIB_ZERO_TANGENT_DIST 各カメラの接線方向の歪み係数を0に設定し、その値で固定する。
        • REF: CALIB_FIX_K1,..., REF: CALIB_FIX_K6 最適化の際に対応する放射方向の歪み係数を変更しない。REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合は、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_RATIONAL_MODEL 係数 k4、k5、k6 を有効にする。後方互換性を保つため、キャリブレーション関数に有理モデルを使用させ8個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_THIN_PRISM_MODEL 係数 s1、s2、s3、s4 を有効にする。後方互換性を保つため、キャリブレーション関数に薄プリズムモデルを使用させ12個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_FIX_S1_S2_S3_S4 薄プリズム歪み係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        • REF: CALIB_TILTED_MODEL 係数 tauX と tauY を有効にする。後方互換性を保つため、キャリブレーション関数に傾斜センサモデルを使用させ14個の係数を返させるには、この追加フラグを明示的に指定する必要がある。フラグが設定されていない場合、関数は5個の歪み係数のみを計算して返す。
        • REF: CALIB_FIX_TAUX_TAUY 傾斜センサモデルの係数は最適化の間変更されない。 REF: CALIB_USE_INTRINSIC_GUESS が設定されている場合、与えられた distCoeffs 行列の係数が使用される。そうでない場合は0に設定される。
        The function estimates the transformation between two cameras making a stereo pair. If one computes the poses of an object relative to the first camera and to the second camera, ( \(R_1\),\(T_1\) ) and (\(R_2\),\(T_2\)), respectively, for a stereo camera where the relative position and orientation between the two cameras are fixed, then those poses definitely relate to each other. This means, if the relative position and orientation (\(R\),\(T\)) of the two cameras is known, it is possible to compute (\(R_2\),\(T_2\)) when (\(R_1\),\(T_1\)) is given. This is what the described function does. It computes (\(R\),\(T\)) such that: \(R_2=R R_1\) \(T_2=R T_1 + T.\) Therefore, one can compute the coordinate representation of a 3D point for the second camera's coordinate system when given the point's coordinate representation in the first camera's coordinate system: \(\begin{bmatrix} X_2 \\ Y_2 \\ Z_2 \\ 1 \end{bmatrix} = \begin{bmatrix} R & T \\ 0 & 1 \end{bmatrix} \begin{bmatrix} X_1 \\ Y_1 \\ Z_1 \\ 1 \end{bmatrix}.\) Optionally, it computes the essential matrix E: \(E= \vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} R\) where \(T_i\) are components of the translation vector \(T\) : \(T=[T_0, T_1, T_2]^T\) . And the function can also compute the fundamental matrix F: \(F = cameraMatrix2^{-T}\cdot E \cdot cameraMatrix1^{-1}\) Besides the stereo-related information, the function can also perform a full calibration of each of the two cameras. However, due to the high dimensionality of the parameter space and noise in the input data, the function can diverge from the correct solution. If the intrinsic parameters can be estimated with high accuracy for each of the cameras individually (for example, using #calibrateCamera ), you are recommended to do so and then pass REF: CALIB_FIX_INTRINSIC flag to the function along with the computed intrinsic parameters. Otherwise, if all the parameters are estimated at once, it makes sense to restrict some parameters, for example, pass REF: CALIB_SAME_FOCAL_LENGTH and REF: CALIB_ZERO_TANGENT_DIST flags, which is usually a reasonable assumption. Similarly to #calibrateCamera, the function minimizes the total re-projection error for all the points in all the available views from both cameras. The function returns the final value of the re-projection error.
        戻り値:
        自動生成
      • stereoCalibrate

        public static double stereoCalibrate​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints1,
                                             java.util.List<Mat> imagePoints2,
                                             Mat cameraMatrix1,
                                             Mat distCoeffs1,
                                             Mat cameraMatrix2,
                                             Mat distCoeffs2,
                                             Size imageSize,
                                             Mat R,
                                             Mat T,
                                             Mat E,
                                             Mat F,
                                             int flags,
                                             TermCriteria criteria)
      • stereoCalibrate

        public static double stereoCalibrate​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints1,
                                             java.util.List<Mat> imagePoints2,
                                             Mat cameraMatrix1,
                                             Mat distCoeffs1,
                                             Mat cameraMatrix2,
                                             Mat distCoeffs2,
                                             Size imageSize,
                                             Mat R,
                                             Mat T,
                                             Mat E,
                                             Mat F,
                                             int flags)
      • stereoCalibrate

        public static double stereoCalibrate​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints1,
                                             java.util.List<Mat> imagePoints2,
                                             Mat cameraMatrix1,
                                             Mat distCoeffs1,
                                             Mat cameraMatrix2,
                                             Mat distCoeffs2,
                                             Size imageSize,
                                             Mat R,
                                             Mat T,
                                             Mat E,
                                             Mat F)
      • stereoCalibrate

        public static double stereoCalibrate​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints1,
                                             java.util.List<Mat> imagePoints2,
                                             Mat cameraMatrix1,
                                             Mat distCoeffs1,
                                             Mat cameraMatrix2,
                                             Mat distCoeffs2,
                                             Size imageSize,
                                             Mat R,
                                             Mat T,
                                             Mat E,
                                             Mat F,
                                             Mat perViewErrors,
                                             int flags,
                                             TermCriteria criteria)
      • stereoCalibrate

        public static double stereoCalibrate​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints1,
                                             java.util.List<Mat> imagePoints2,
                                             Mat cameraMatrix1,
                                             Mat distCoeffs1,
                                             Mat cameraMatrix2,
                                             Mat distCoeffs2,
                                             Size imageSize,
                                             Mat R,
                                             Mat T,
                                             Mat E,
                                             Mat F,
                                             Mat perViewErrors,
                                             int flags)
      • stereoCalibrate

        public static double stereoCalibrate​(java.util.List<Mat> objectPoints,
                                             java.util.List<Mat> imagePoints1,
                                             java.util.List<Mat> imagePoints2,
                                             Mat cameraMatrix1,
                                             Mat distCoeffs1,
                                             Mat cameraMatrix2,
                                             Mat distCoeffs2,
                                             Size imageSize,
                                             Mat R,
                                             Mat T,
                                             Mat E,
                                             Mat F,
                                             Mat perViewErrors)
      • stereoRectify

        public static void stereoRectify​(Mat cameraMatrix1,
                                         Mat distCoeffs1,
                                         Mat cameraMatrix2,
                                         Mat distCoeffs2,
                                         Size imageSize,
                                         Mat R,
                                         Mat T,
                                         Mat R1,
                                         Mat R2,
                                         Mat P1,
                                         Mat P2,
                                         Mat Q,
                                         int flags,
                                         double alpha,
                                         Size newImageSize,
                                         Rect validPixROI1,
                                         Rect validPixROI2)
        Computes rectification transforms for each head of a calibrated stereo camera.
        引数:
        cameraMatrix1 - 第1カメラの内部行列。
        distCoeffs1 - 第1カメラの歪みパラメータ。
        cameraMatrix2 - 第2カメラの内部行列。
        distCoeffs2 - 第2カメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 第1カメラの座標系から第2カメラへの回転行列。REF: stereoCalibrate を参照。
        T - 第1カメラの座標系から第2カメラへの並進ベクトル。REF: stereoCalibrate を参照。
        R1 - 第1カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第1カメラの座標系で与えられた点を、平行化された第1カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第1カメラの座標系から平行化された第1カメラの座標系への基底変換を行う。
        R2 - 第2カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第2カメラの座標系で与えられた点を、平行化された第2カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第2カメラの座標系から平行化された第2カメラの座標系への基底変換を行う。
        P1 - 第1カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第1カメラの画像へ射影する。
        P2 - 第2カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第2カメラの画像へ射影する。
        Q - 出力 \(4 \times 4\) 視差から深度への写像行列(REF: reprojectImageTo3D を参照)。
        flags - 0 または REF: CALIB_ZERO_DISPARITY を指定できる動作フラグ。フラグが設定されている場合、関数は各カメラの主点が平行化されたビューにおいて同じピクセル座標を持つようにする。フラグが設定されていない場合は、有効な画像領域を最大化するために、(エピポーラ線の向きに応じて)水平方向または垂直方向に画像をずらすことがある。
        alpha - 自由スケーリングパラメータ。-1 または指定されていない場合、関数はデフォルトのスケーリングを実行する。それ以外の場合、このパラメータは0から1の間でなければならない。alpha=0 は、有効なピクセルのみが見えるように(平行化後に黒い領域が生じないように)平行化画像が拡大・移動されることを意味する。alpha=1 は、カメラの元画像のすべてのピクセルが平行化画像に保持される(元画像のピクセルが失われない)ように、平行化画像が縮小・移動されることを意味する。中間の値はこれら両極端の間の中間的な結果をもたらす。
        newImageSize - 平行化後の新しい画像解像度。同じサイズを #initUndistortRectifyMap に渡す必要がある(OpenCV の samples ディレクトリにある stereo_calib.cpp サンプルを参照)。(0,0) を渡した場合(デフォルト)、元の imageSize に設定される。これをより大きな値に設定すると、特に大きな放射方向の歪みがある場合に、元画像の細部を保持するのに役立つ。
        validPixROI1 - 平行化画像内ですべてのピクセルが有効となる省略可能な出力矩形。alpha=0 の場合、ROI は画像全体を覆う。それ以外の場合は、より小さくなる可能性が高い(下図を参照)。
        validPixROI2 - Optional output rectangles inside the rectified images where all the pixels are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. The function takes the matrices computed by #stereoCalibrate as input. As output, it provides two rotation matrices and also two projection matrices in the new coordinates. The function distinguishes the following two cases:
        • 水平ステレオ: 第1カメラと第2カメラのビューが、主にx軸に沿って互いにずれている(垂直方向の小さなずれも起こりうる)。平行化された画像では、左右のカメラの対応するエピポーラ線は水平で、同じy座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x \cdot f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx_1 \\ 0 & 1 & 0 & -cy \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_x} & \frac{cx_1 - cx_2}{T_x} \end{bmatrix} \) where \(T_x\) is a horizontal shift between the cameras and \(cx_1=cx_2\) if REF: CALIB_ZERO_DISPARITY is set.
        • 垂直ステレオ: 第1カメラと第2カメラのビューが、主に垂直方向に互いにずれている(おそらく水平方向にも少しずれている)。平行化された画像のエピポーラ線は垂直で、同じx座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y \cdot f \\ 0 & 0 & 1 & 0 \end{bmatrix},\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx \\ 0 & 1 & 0 & -cy_1 \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_y} & \frac{cy_1 - cy_2}{T_y} \end{bmatrix} \) where \(T_y\) is a vertical shift between the cameras and \(cy_1=cy_2\) if REF: CALIB_ZERO_DISPARITY is set. As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera matrices. The matrices, together with R1 and R2 , can then be passed to #initUndistortRectifyMap to initialize the rectification map for each camera. See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through the corresponding image regions. This means that the images are well rectified, which is what most stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that their interiors are all valid pixels. ![image](pics/stereo_undistort.jpg)
      • stereoRectify

        public static void stereoRectify​(Mat cameraMatrix1,
                                         Mat distCoeffs1,
                                         Mat cameraMatrix2,
                                         Mat distCoeffs2,
                                         Size imageSize,
                                         Mat R,
                                         Mat T,
                                         Mat R1,
                                         Mat R2,
                                         Mat P1,
                                         Mat P2,
                                         Mat Q,
                                         int flags,
                                         double alpha,
                                         Size newImageSize,
                                         Rect validPixROI1)
        Computes rectification transforms for each head of a calibrated stereo camera.
        引数:
        cameraMatrix1 - 第1カメラの内部行列。
        distCoeffs1 - 第1カメラの歪みパラメータ。
        cameraMatrix2 - 第2カメラの内部行列。
        distCoeffs2 - 第2カメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 第1カメラの座標系から第2カメラへの回転行列。REF: stereoCalibrate を参照。
        T - 第1カメラの座標系から第2カメラへの並進ベクトル。REF: stereoCalibrate を参照。
        R1 - 第1カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第1カメラの座標系で与えられた点を、平行化された第1カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第1カメラの座標系から平行化された第1カメラの座標系への基底変換を行う。
        R2 - 第2カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第2カメラの座標系で与えられた点を、平行化された第2カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第2カメラの座標系から平行化された第2カメラの座標系への基底変換を行う。
        P1 - 第1カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第1カメラの画像へ射影する。
        P2 - 第2カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第2カメラの画像へ射影する。
        Q - 出力 \(4 \times 4\) 視差から深度への写像行列(REF: reprojectImageTo3D を参照)。
        flags - 0 または REF: CALIB_ZERO_DISPARITY を指定できる動作フラグ。フラグが設定されている場合、関数は各カメラの主点が平行化されたビューにおいて同じピクセル座標を持つようにする。フラグが設定されていない場合は、有効な画像領域を最大化するために、(エピポーラ線の向きに応じて)水平方向または垂直方向に画像をずらすことがある。
        alpha - 自由スケーリングパラメータ。-1 または指定されていない場合、関数はデフォルトのスケーリングを実行する。それ以外の場合、このパラメータは0から1の間でなければならない。alpha=0 は、有効なピクセルのみが見えるように(平行化後に黒い領域が生じないように)平行化画像が拡大・移動されることを意味する。alpha=1 は、カメラの元画像のすべてのピクセルが平行化画像に保持される(元画像のピクセルが失われない)ように、平行化画像が縮小・移動されることを意味する。中間の値はこれら両極端の間の中間的な結果をもたらす。
        newImageSize - 平行化後の新しい画像解像度。同じサイズを #initUndistortRectifyMap に渡す必要がある(OpenCV の samples ディレクトリにある stereo_calib.cpp サンプルを参照)。(0,0) を渡した場合(デフォルト)、元の imageSize に設定される。これをより大きな値に設定すると、特に大きな放射方向の歪みがある場合に、元画像の細部を保持するのに役立つ。
        validPixROI1 - Optional output rectangles inside the rectified images where all the pixels are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. The function takes the matrices computed by #stereoCalibrate as input. As output, it provides two rotation matrices and also two projection matrices in the new coordinates. The function distinguishes the following two cases:
        • 水平ステレオ: 第1カメラと第2カメラのビューが、主にx軸に沿って互いにずれている(垂直方向の小さなずれも起こりうる)。平行化された画像では、左右のカメラの対応するエピポーラ線は水平で、同じy座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x \cdot f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx_1 \\ 0 & 1 & 0 & -cy \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_x} & \frac{cx_1 - cx_2}{T_x} \end{bmatrix} \) where \(T_x\) is a horizontal shift between the cameras and \(cx_1=cx_2\) if REF: CALIB_ZERO_DISPARITY is set.
        • 垂直ステレオ: 第1カメラと第2カメラのビューが、主に垂直方向に互いにずれている(おそらく水平方向にも少しずれている)。平行化された画像のエピポーラ線は垂直で、同じx座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y \cdot f \\ 0 & 0 & 1 & 0 \end{bmatrix},\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx \\ 0 & 1 & 0 & -cy_1 \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_y} & \frac{cy_1 - cy_2}{T_y} \end{bmatrix} \) where \(T_y\) is a vertical shift between the cameras and \(cy_1=cy_2\) if REF: CALIB_ZERO_DISPARITY is set. As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera matrices. The matrices, together with R1 and R2 , can then be passed to #initUndistortRectifyMap to initialize the rectification map for each camera. See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through the corresponding image regions. This means that the images are well rectified, which is what most stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that their interiors are all valid pixels. ![image](pics/stereo_undistort.jpg)
      • stereoRectify

        public static void stereoRectify​(Mat cameraMatrix1,
                                         Mat distCoeffs1,
                                         Mat cameraMatrix2,
                                         Mat distCoeffs2,
                                         Size imageSize,
                                         Mat R,
                                         Mat T,
                                         Mat R1,
                                         Mat R2,
                                         Mat P1,
                                         Mat P2,
                                         Mat Q,
                                         int flags,
                                         double alpha,
                                         Size newImageSize)
        Computes rectification transforms for each head of a calibrated stereo camera.
        引数:
        cameraMatrix1 - 第1カメラの内部行列。
        distCoeffs1 - 第1カメラの歪みパラメータ。
        cameraMatrix2 - 第2カメラの内部行列。
        distCoeffs2 - 第2カメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 第1カメラの座標系から第2カメラへの回転行列。REF: stereoCalibrate を参照。
        T - 第1カメラの座標系から第2カメラへの並進ベクトル。REF: stereoCalibrate を参照。
        R1 - 第1カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第1カメラの座標系で与えられた点を、平行化された第1カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第1カメラの座標系から平行化された第1カメラの座標系への基底変換を行う。
        R2 - 第2カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第2カメラの座標系で与えられた点を、平行化された第2カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第2カメラの座標系から平行化された第2カメラの座標系への基底変換を行う。
        P1 - 第1カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第1カメラの画像へ射影する。
        P2 - 第2カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第2カメラの画像へ射影する。
        Q - 出力 \(4 \times 4\) 視差から深度への写像行列(REF: reprojectImageTo3D を参照)。
        flags - 0 または REF: CALIB_ZERO_DISPARITY を指定できる動作フラグ。フラグが設定されている場合、関数は各カメラの主点が平行化されたビューにおいて同じピクセル座標を持つようにする。フラグが設定されていない場合は、有効な画像領域を最大化するために、(エピポーラ線の向きに応じて)水平方向または垂直方向に画像をずらすことがある。
        alpha - 自由スケーリングパラメータ。-1 または指定されていない場合、関数はデフォルトのスケーリングを実行する。それ以外の場合、このパラメータは0から1の間でなければならない。alpha=0 は、有効なピクセルのみが見えるように(平行化後に黒い領域が生じないように)平行化画像が拡大・移動されることを意味する。alpha=1 は、カメラの元画像のすべてのピクセルが平行化画像に保持される(元画像のピクセルが失われない)ように、平行化画像が縮小・移動されることを意味する。中間の値はこれら両極端の間の中間的な結果をもたらす。
        newImageSize - New image resolution after rectification. The same size should be passed to #initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) is passed (default), it is set to the original imageSize . Setting it to a larger value can help you preserve details in the original image, especially when there is a big radial distortion. are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. The function takes the matrices computed by #stereoCalibrate as input. As output, it provides two rotation matrices and also two projection matrices in the new coordinates. The function distinguishes the following two cases:
        • 水平ステレオ: 第1カメラと第2カメラのビューが、主にx軸に沿って互いにずれている(垂直方向の小さなずれも起こりうる)。平行化された画像では、左右のカメラの対応するエピポーラ線は水平で、同じy座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x \cdot f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx_1 \\ 0 & 1 & 0 & -cy \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_x} & \frac{cx_1 - cx_2}{T_x} \end{bmatrix} \) where \(T_x\) is a horizontal shift between the cameras and \(cx_1=cx_2\) if REF: CALIB_ZERO_DISPARITY is set.
        • 垂直ステレオ: 第1カメラと第2カメラのビューが、主に垂直方向に互いにずれている(おそらく水平方向にも少しずれている)。平行化された画像のエピポーラ線は垂直で、同じx座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y \cdot f \\ 0 & 0 & 1 & 0 \end{bmatrix},\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx \\ 0 & 1 & 0 & -cy_1 \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_y} & \frac{cy_1 - cy_2}{T_y} \end{bmatrix} \) where \(T_y\) is a vertical shift between the cameras and \(cy_1=cy_2\) if REF: CALIB_ZERO_DISPARITY is set. As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera matrices. The matrices, together with R1 and R2 , can then be passed to #initUndistortRectifyMap to initialize the rectification map for each camera. See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through the corresponding image regions. This means that the images are well rectified, which is what most stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that their interiors are all valid pixels. ![image](pics/stereo_undistort.jpg)
      • stereoRectify

        public static void stereoRectify​(Mat cameraMatrix1,
                                         Mat distCoeffs1,
                                         Mat cameraMatrix2,
                                         Mat distCoeffs2,
                                         Size imageSize,
                                         Mat R,
                                         Mat T,
                                         Mat R1,
                                         Mat R2,
                                         Mat P1,
                                         Mat P2,
                                         Mat Q,
                                         int flags,
                                         double alpha)
        Computes rectification transforms for each head of a calibrated stereo camera.
        引数:
        cameraMatrix1 - 第1カメラの内部行列。
        distCoeffs1 - 第1カメラの歪みパラメータ。
        cameraMatrix2 - 第2カメラの内部行列。
        distCoeffs2 - 第2カメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 第1カメラの座標系から第2カメラへの回転行列。REF: stereoCalibrate を参照。
        T - 第1カメラの座標系から第2カメラへの並進ベクトル。REF: stereoCalibrate を参照。
        R1 - 第1カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第1カメラの座標系で与えられた点を、平行化された第1カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第1カメラの座標系から平行化された第1カメラの座標系への基底変換を行う。
        R2 - 第2カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第2カメラの座標系で与えられた点を、平行化された第2カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第2カメラの座標系から平行化された第2カメラの座標系への基底変換を行う。
        P1 - 第1カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第1カメラの画像へ射影する。
        P2 - 第2カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第2カメラの画像へ射影する。
        Q - 出力 \(4 \times 4\) 視差から深度への写像行列(REF: reprojectImageTo3D を参照)。
        flags - 0 または REF: CALIB_ZERO_DISPARITY を指定できる動作フラグ。フラグが設定されている場合、関数は各カメラの主点が平行化されたビューにおいて同じピクセル座標を持つようにする。フラグが設定されていない場合は、有効な画像領域を最大化するために、(エピポーラ線の向きに応じて)水平方向または垂直方向に画像をずらすことがある。
        alpha - Free scaling parameter. If it is -1 or absent, the function performs the default scaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified images are zoomed and shifted so that only valid pixels are visible (no black areas after rectification). alpha=1 means that the rectified image is decimated and shifted so that all the pixels from the original images from the cameras are retained in the rectified images (no source image pixels are lost). Any intermediate value yields an intermediate result between those two extreme cases. #initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) is passed (default), it is set to the original imageSize . Setting it to a larger value can help you preserve details in the original image, especially when there is a big radial distortion. are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. The function takes the matrices computed by #stereoCalibrate as input. As output, it provides two rotation matrices and also two projection matrices in the new coordinates. The function distinguishes the following two cases:
        • 水平ステレオ: 第1カメラと第2カメラのビューが、主にx軸に沿って互いにずれている(垂直方向の小さなずれも起こりうる)。平行化された画像では、左右のカメラの対応するエピポーラ線は水平で、同じy座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x \cdot f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx_1 \\ 0 & 1 & 0 & -cy \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_x} & \frac{cx_1 - cx_2}{T_x} \end{bmatrix} \) where \(T_x\) is a horizontal shift between the cameras and \(cx_1=cx_2\) if REF: CALIB_ZERO_DISPARITY is set.
        • 垂直ステレオ: 第1カメラと第2カメラのビューが、主に垂直方向に互いにずれている(おそらく水平方向にも少しずれている)。平行化された画像のエピポーラ線は垂直で、同じx座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y \cdot f \\ 0 & 0 & 1 & 0 \end{bmatrix},\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx \\ 0 & 1 & 0 & -cy_1 \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_y} & \frac{cy_1 - cy_2}{T_y} \end{bmatrix} \) where \(T_y\) is a vertical shift between the cameras and \(cy_1=cy_2\) if REF: CALIB_ZERO_DISPARITY is set. As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera matrices. The matrices, together with R1 and R2 , can then be passed to #initUndistortRectifyMap to initialize the rectification map for each camera. See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through the corresponding image regions. This means that the images are well rectified, which is what most stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that their interiors are all valid pixels. ![image](pics/stereo_undistort.jpg)
      • stereoRectify

        public static void stereoRectify​(Mat cameraMatrix1,
                                         Mat distCoeffs1,
                                         Mat cameraMatrix2,
                                         Mat distCoeffs2,
                                         Size imageSize,
                                         Mat R,
                                         Mat T,
                                         Mat R1,
                                         Mat R2,
                                         Mat P1,
                                         Mat P2,
                                         Mat Q,
                                         int flags)
        Computes rectification transforms for each head of a calibrated stereo camera.
        引数:
        cameraMatrix1 - 第1カメラの内部行列。
        distCoeffs1 - 第1カメラの歪みパラメータ。
        cameraMatrix2 - 第2カメラの内部行列。
        distCoeffs2 - 第2カメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 第1カメラの座標系から第2カメラへの回転行列。REF: stereoCalibrate を参照。
        T - 第1カメラの座標系から第2カメラへの並進ベクトル。REF: stereoCalibrate を参照。
        R1 - 第1カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第1カメラの座標系で与えられた点を、平行化された第1カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第1カメラの座標系から平行化された第1カメラの座標系への基底変換を行う。
        R2 - 第2カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第2カメラの座標系で与えられた点を、平行化された第2カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第2カメラの座標系から平行化された第2カメラの座標系への基底変換を行う。
        P1 - 第1カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第1カメラの画像へ射影する。
        P2 - 第2カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第2カメラの画像へ射影する。
        Q - 出力 \(4 \times 4\) 視差から深度への写像行列(REF: reprojectImageTo3D を参照)。
        flags - Operation flags that may be zero or REF: CALIB_ZERO_DISPARITY . If the flag is set, the function makes the principal points of each camera have the same pixel coordinates in the rectified views. And if the flag is not set, the function may still shift the images in the horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the useful image area. scaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified images are zoomed and shifted so that only valid pixels are visible (no black areas after rectification). alpha=1 means that the rectified image is decimated and shifted so that all the pixels from the original images from the cameras are retained in the rectified images (no source image pixels are lost). Any intermediate value yields an intermediate result between those two extreme cases. #initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) is passed (default), it is set to the original imageSize . Setting it to a larger value can help you preserve details in the original image, especially when there is a big radial distortion. are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. The function takes the matrices computed by #stereoCalibrate as input. As output, it provides two rotation matrices and also two projection matrices in the new coordinates. The function distinguishes the following two cases:
        • 水平ステレオ: 第1カメラと第2カメラのビューが、主にx軸に沿って互いにずれている(垂直方向の小さなずれも起こりうる)。平行化された画像では、左右のカメラの対応するエピポーラ線は水平で、同じy座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x \cdot f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx_1 \\ 0 & 1 & 0 & -cy \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_x} & \frac{cx_1 - cx_2}{T_x} \end{bmatrix} \) where \(T_x\) is a horizontal shift between the cameras and \(cx_1=cx_2\) if REF: CALIB_ZERO_DISPARITY is set.
        • 垂直ステレオ: 第1カメラと第2カメラのビューが、主に垂直方向に互いにずれている(おそらく水平方向にも少しずれている)。平行化された画像のエピポーラ線は垂直で、同じx座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y \cdot f \\ 0 & 0 & 1 & 0 \end{bmatrix},\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx \\ 0 & 1 & 0 & -cy_1 \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_y} & \frac{cy_1 - cy_2}{T_y} \end{bmatrix} \) where \(T_y\) is a vertical shift between the cameras and \(cy_1=cy_2\) if REF: CALIB_ZERO_DISPARITY is set. As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera matrices. The matrices, together with R1 and R2 , can then be passed to #initUndistortRectifyMap to initialize the rectification map for each camera. See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through the corresponding image regions. This means that the images are well rectified, which is what most stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that their interiors are all valid pixels. ![image](pics/stereo_undistort.jpg)
      • stereoRectify

        public static void stereoRectify​(Mat cameraMatrix1,
                                         Mat distCoeffs1,
                                         Mat cameraMatrix2,
                                         Mat distCoeffs2,
                                         Size imageSize,
                                         Mat R,
                                         Mat T,
                                         Mat R1,
                                         Mat R2,
                                         Mat P1,
                                         Mat P2,
                                         Mat Q)
        Computes rectification transforms for each head of a calibrated stereo camera.
        引数:
        cameraMatrix1 - 第1カメラの内部行列。
        distCoeffs1 - 第1カメラの歪みパラメータ。
        cameraMatrix2 - 第2カメラの内部行列。
        distCoeffs2 - 第2カメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 第1カメラの座標系から第2カメラへの回転行列。REF: stereoCalibrate を参照。
        T - 第1カメラの座標系から第2カメラへの並進ベクトル。REF: stereoCalibrate を参照。
        R1 - 第1カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第1カメラの座標系で与えられた点を、平行化された第1カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第1カメラの座標系から平行化された第1カメラの座標系への基底変換を行う。
        R2 - 第2カメラの出力3x3平行化変換(回転行列)。この行列は、平行化されていない第2カメラの座標系で与えられた点を、平行化された第2カメラの座標系の点へと変換する。より技術的に言えば、平行化されていない第2カメラの座標系から平行化された第2カメラの座標系への基底変換を行う。
        P1 - 第1カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第1カメラの画像へ射影する。
        P2 - 第2カメラの新しい(平行化された)座標系における出力3x4射影行列。すなわち、平行化された第1カメラ座標系で与えられた点を平行化された第2カメラの画像へ射影する。
        Q - Output \(4 \times 4\) disparity-to-depth mapping matrix (see REF: reprojectImageTo3D). the function makes the principal points of each camera have the same pixel coordinates in the rectified views. And if the flag is not set, the function may still shift the images in the horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the useful image area. scaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified images are zoomed and shifted so that only valid pixels are visible (no black areas after rectification). alpha=1 means that the rectified image is decimated and shifted so that all the pixels from the original images from the cameras are retained in the rectified images (no source image pixels are lost). Any intermediate value yields an intermediate result between those two extreme cases. #initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) is passed (default), it is set to the original imageSize . Setting it to a larger value can help you preserve details in the original image, especially when there is a big radial distortion. are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below). The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. The function takes the matrices computed by #stereoCalibrate as input. As output, it provides two rotation matrices and also two projection matrices in the new coordinates. The function distinguishes the following two cases:
        • 水平ステレオ: 第1カメラと第2カメラのビューが、主にx軸に沿って互いにずれている(垂直方向の小さなずれも起こりうる)。平行化された画像では、左右のカメラの対応するエピポーラ線は水平で、同じy座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x \cdot f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx_1 \\ 0 & 1 & 0 & -cy \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_x} & \frac{cx_1 - cx_2}{T_x} \end{bmatrix} \) where \(T_x\) is a horizontal shift between the cameras and \(cx_1=cx_2\) if REF: CALIB_ZERO_DISPARITY is set.
        • 垂直ステレオ: 第1カメラと第2カメラのビューが、主に垂直方向に互いにずれている(おそらく水平方向にも少しずれている)。平行化された画像のエピポーラ線は垂直で、同じx座標を持つ。P1 と P2 は次のようになる:
        \(\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\) \(\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y \cdot f \\ 0 & 0 & 1 & 0 \end{bmatrix},\) \(\texttt{Q} = \begin{bmatrix} 1 & 0 & 0 & -cx \\ 0 & 1 & 0 & -cy_1 \\ 0 & 0 & 0 & f \\ 0 & 0 & -\frac{1}{T_y} & \frac{cy_1 - cy_2}{T_y} \end{bmatrix} \) where \(T_y\) is a vertical shift between the cameras and \(cy_1=cy_2\) if REF: CALIB_ZERO_DISPARITY is set. As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera matrices. The matrices, together with R1 and R2 , can then be passed to #initUndistortRectifyMap to initialize the rectification map for each camera. See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through the corresponding image regions. This means that the images are well rectified, which is what most stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that their interiors are all valid pixels. ![image](pics/stereo_undistort.jpg)
      • stereoRectifyUncalibrated

        public static boolean stereoRectifyUncalibrated​(Mat points1,
                                                        Mat points2,
                                                        Mat F,
                                                        Size imgSize,
                                                        Mat H1,
                                                        Mat H2,
                                                        double threshold)
        Computes a rectification transform for an uncalibrated stereo camera.
        引数:
        points1 - 第1画像の特徴点の配列。
        points2 - 第2画像における対応する点。#findFundamentalMat と同じ形式がサポートされている。
        F - 入力基礎行列。同じ点ペアの集合から #findFundamentalMat を用いて計算できる。
        imgSize - 画像のサイズ。
        H1 - 第1画像の出力平行化ホモグラフィ行列。
        H2 - 第2画像の出力平行化ホモグラフィ行列。
        threshold - 外れ値を除外するために使用する省略可能なしきい値。パラメータが0より大きい場合、エピポーラ幾何に適合しないすべての点ペア(すなわち \(|\texttt{points2[i]}^T \cdot \texttt{F} \cdot \texttt{points1[i]}|>\texttt{threshold}\) となる点)は、ホモグラフィを計算する前に除外される。それ以外の場合、すべての点がインライアとみなされる。この関数は、カメラの内部パラメータや空間内での相対位置を知らずに平行化変換を計算するため、接尾辞「uncalibrated」が付いている。#stereoRectify とのもう一つの関連する違いは、この関数が物体(3D)空間での平行化変換ではなく、ホモグラフィ行列 H1 と H2 によって符号化された平面透視変換を出力する点である。この関数はアルゴリズム CITE: Hartley99 を実装している。注: このアルゴリズムはカメラの内部パラメータを知る必要はないが、エピポーラ幾何に大きく依存する。したがって、カメラレンズに大きな歪みがある場合は、基礎行列を計算しこの関数を呼び出す前にそれを補正しておくほうがよい。たとえば、#calibrateCamera を使用してステレオカメラの各ヘッドごとに歪み係数を個別に推定できる。その後、#undistort を使用して画像を補正するか、あるいは #undistortPoints を使用して点の座標だけを補正できる。
        戻り値:
        自動生成
      • stereoRectifyUncalibrated

        public static boolean stereoRectifyUncalibrated​(Mat points1,
                                                        Mat points2,
                                                        Mat F,
                                                        Size imgSize,
                                                        Mat H1,
                                                        Mat H2)
        Computes a rectification transform for an uncalibrated stereo camera.
        引数:
        points1 - 第1画像の特徴点の配列。
        points2 - 第2画像における対応する点。#findFundamentalMat と同じ形式がサポートされている。
        F - 入力基礎行列。同じ点ペアの集合から #findFundamentalMat を用いて計算できる。
        imgSize - 画像のサイズ。
        H1 - 第1画像の出力平行化ホモグラフィ行列。
        H2 - 第2画像の出力平行化ホモグラフィ行列。0より大きい場合、エピポーラ幾何に適合しないすべての点ペア(すなわち \(|\texttt{points2[i]}^T \cdot \texttt{F} \cdot \texttt{points1[i]}|>\texttt{threshold}\) となる点)は、ホモグラフィを計算する前に除外される。それ以外の場合、すべての点がインライアとみなされる。この関数は、カメラの内部パラメータや空間内での相対位置を知らずに平行化変換を計算するため、接尾辞「uncalibrated」が付いている。#stereoRectify とのもう一つの関連する違いは、この関数が物体(3D)空間での平行化変換ではなく、ホモグラフィ行列 H1 と H2 によって符号化された平面透視変換を出力する点である。この関数はアルゴリズム CITE: Hartley99 を実装している。注: このアルゴリズムはカメラの内部パラメータを知る必要はないが、エピポーラ幾何に大きく依存する。したがって、カメラレンズに大きな歪みがある場合は、基礎行列を計算しこの関数を呼び出す前にそれを補正しておくほうがよい。たとえば、#calibrateCamera を使用してステレオカメラの各ヘッドごとに歪み係数を個別に推定できる。その後、#undistort を使用して画像を補正するか、あるいは #undistortPoints を使用して点の座標だけを補正できる。
        戻り値:
        自動生成
      • rectify3Collinear

        public static float rectify3Collinear​(Mat cameraMatrix1,
                                              Mat distCoeffs1,
                                              Mat cameraMatrix2,
                                              Mat distCoeffs2,
                                              Mat cameraMatrix3,
                                              Mat distCoeffs3,
                                              java.util.List<Mat> imgpt1,
                                              java.util.List<Mat> imgpt3,
                                              Size imageSize,
                                              Mat R12,
                                              Mat T12,
                                              Mat R13,
                                              Mat T13,
                                              Mat R1,
                                              Mat R2,
                                              Mat R3,
                                              Mat P1,
                                              Mat P2,
                                              Mat P3,
                                              Mat Q,
                                              double alpha,
                                              Size newImgSize,
                                              Rect roi1,
                                              Rect roi2,
                                              int flags)
      • getOptimalNewCameraMatrix

        public static Mat getOptimalNewCameraMatrix​(Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    Size imageSize,
                                                    double alpha,
                                                    Size newImgSize,
                                                    Rect validPixROI,
                                                    boolean centerPrincipalPoint)
        Returns the new camera intrinsic matrix based on the free scaling parameter.
        引数:
        cameraMatrix - 入力カメラ内部行列。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        imageSize - 元の画像サイズ。
        alpha - 0(歪み補正後の画像のすべてのピクセルが有効となる場合)から1(元画像のすべてのピクセルが歪み補正後の画像に保持される場合)の間の自由スケーリングパラメータ。詳細は #stereoRectify を参照。
        newImgSize - 平行化後の画像サイズ。デフォルトでは imageSize に設定される。
        validPixROI - 歪み補正後の画像においてすべて良好なピクセルからなる領域を囲む省略可能な出力矩形。#stereoRectify の roi1、roi2 の説明を参照。
        centerPrincipalPoint - 新しいカメラ内部行列において主点を画像中心に置くかどうかを示す省略可能なフラグ。デフォルトでは、主点は(alpha によって決まる)元画像の部分集合を補正後の画像に最もよく適合させるように選ばれる。
        戻り値:
        new_camera_matrix 出力される新しいカメラ内部行列。この関数は、自由スケーリングパラメータに基づいて最適な新しいカメラ内部行列を計算して返す。このパラメータを変化させることで、意味のあるピクセルのみを取得する alpha=0 、コーナーに価値ある情報がある場合に元画像のすべてのピクセルを保持する alpha=1 、あるいはその中間の結果を得ることができる。alpha>0 の場合、歪み補正後の結果には、撮影された歪み画像の外側にある「仮想」ピクセルに対応する黒いピクセルが含まれる可能性が高い。元のカメラ内部行列、歪み係数、計算された新しいカメラ内部行列、および newImageSize を #initUndistortRectifyMap に渡して、#remap 用のマップを生成すべきである。
      • getOptimalNewCameraMatrix

        public static Mat getOptimalNewCameraMatrix​(Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    Size imageSize,
                                                    double alpha,
                                                    Size newImgSize,
                                                    Rect validPixROI)
        Returns the new camera intrinsic matrix based on the free scaling parameter.
        引数:
        cameraMatrix - 入力カメラ内部行列。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        imageSize - 元の画像サイズ。
        alpha - 0(歪み補正後の画像のすべてのピクセルが有効となる場合)から1(元画像のすべてのピクセルが歪み補正後の画像に保持される場合)の間の自由スケーリングパラメータ。詳細は #stereoRectify を参照。
        newImgSize - 平行化後の画像サイズ。デフォルトでは imageSize に設定される。
        validPixROI - 歪み補正後の画像においてすべて良好なピクセルからなる領域を囲む省略可能な出力矩形。#stereoRectify の roi1、roi2 の説明を参照。主点を画像中心に置くかどうか。デフォルトでは、主点は(alpha によって決まる)元画像の部分集合を補正後の画像に最もよく適合させるように選ばれる。
        戻り値:
        new_camera_matrix 出力される新しいカメラ内部行列。この関数は、自由スケーリングパラメータに基づいて最適な新しいカメラ内部行列を計算して返す。このパラメータを変化させることで、意味のあるピクセルのみを取得する alpha=0 、コーナーに価値ある情報がある場合に元画像のすべてのピクセルを保持する alpha=1 、あるいはその中間の結果を得ることができる。alpha>0 の場合、歪み補正後の結果には、撮影された歪み画像の外側にある「仮想」ピクセルに対応する黒いピクセルが含まれる可能性が高い。元のカメラ内部行列、歪み係数、計算された新しいカメラ内部行列、および newImageSize を #initUndistortRectifyMap に渡して、#remap 用のマップを生成すべきである。
      • getOptimalNewCameraMatrix

        public static Mat getOptimalNewCameraMatrix​(Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    Size imageSize,
                                                    double alpha,
                                                    Size newImgSize)
        Returns the new camera intrinsic matrix based on the free scaling parameter.
        引数:
        cameraMatrix - 入力カメラ内部行列。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        imageSize - 元の画像サイズ。
        alpha - 0(歪み補正後の画像のすべてのピクセルが有効となる場合)から1(元画像のすべてのピクセルが歪み補正後の画像に保持される場合)の間の自由スケーリングパラメータ。詳細は #stereoRectify を参照。
        newImgSize - 平行化後の画像サイズ。デフォルトでは imageSize に設定される。歪み補正後の画像。#stereoRectify の roi1、roi2 の説明を参照。主点を画像中心に置くかどうか。デフォルトでは、主点は(alpha によって決まる)元画像の部分集合を補正後の画像に最もよく適合させるように選ばれる。
        戻り値:
        new_camera_matrix 出力される新しいカメラ内部行列。この関数は、自由スケーリングパラメータに基づいて最適な新しいカメラ内部行列を計算して返す。このパラメータを変化させることで、意味のあるピクセルのみを取得する alpha=0 、コーナーに価値ある情報がある場合に元画像のすべてのピクセルを保持する alpha=1 、あるいはその中間の結果を得ることができる。alpha>0 の場合、歪み補正後の結果には、撮影された歪み画像の外側にある「仮想」ピクセルに対応する黒いピクセルが含まれる可能性が高い。元のカメラ内部行列、歪み係数、計算された新しいカメラ内部行列、および newImageSize を #initUndistortRectifyMap に渡して、#remap 用のマップを生成すべきである。
      • getOptimalNewCameraMatrix

        public static Mat getOptimalNewCameraMatrix​(Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    Size imageSize,
                                                    double alpha)
        Returns the new camera intrinsic matrix based on the free scaling parameter.
        引数:
        cameraMatrix - 入力カメラ内部行列。
        distCoeffs - 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。
        imageSize - 元の画像サイズ。
        alpha - 0(歪み補正後の画像のすべてのピクセルが有効となる場合)から1(元画像のすべてのピクセルが歪み補正後の画像に保持される場合)の間の自由スケーリングパラメータ。詳細は #stereoRectify を参照。歪み補正後の画像。#stereoRectify の roi1、roi2 の説明を参照。主点を画像中心に置くかどうか。デフォルトでは、主点は(alpha によって決まる)元画像の部分集合を補正後の画像に最もよく適合させるように選ばれる。
        戻り値:
        new_camera_matrix 出力される新しいカメラ内部行列。この関数は、自由スケーリングパラメータに基づいて最適な新しいカメラ内部行列を計算して返す。このパラメータを変化させることで、意味のあるピクセルのみを取得する alpha=0 、コーナーに価値ある情報がある場合に元画像のすべてのピクセルを保持する alpha=1 、あるいはその中間の結果を得ることができる。alpha>0 の場合、歪み補正後の結果には、撮影された歪み画像の外側にある「仮想」ピクセルに対応する黒いピクセルが含まれる可能性が高い。元のカメラ内部行列、歪み係数、計算された新しいカメラ内部行列、および newImageSize を #initUndistortRectifyMap に渡して、#remap 用のマップを生成すべきである。
      • calibrateHandEye

        public static void calibrateHandEye​(java.util.List<Mat> R_gripper2base,
                                            java.util.List<Mat> t_gripper2base,
                                            java.util.List<Mat> R_target2cam,
                                            java.util.List<Mat> t_target2cam,
                                            Mat R_cam2gripper,
                                            Mat t_cam2gripper,
                                            int method)
        Computes Hand-Eye calibration: \(_{}^{g}\textrm{T}_c\)
        引数:
        R_gripper2base - グリッパ座標系で表された点をロボットベース座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{b}\textrm{T}_g\))。これは、グリッパ座標系からロボットベース座標系へのすべての変換について、回転((3x3) 回転行列または (3x1) 回転ベクトル)を含むベクトル (vector&lt;Mat&gt;) である。
        t_gripper2base - グリッパ座標系で表された点をロボットベース座標系へ変換する同次行列から抽出した並進部分 (\(_{}^{b}\textrm{T}_g\))。これは、グリッパ座標系からロボットベース座標系へのすべての変換について、(3x1) 並進ベクトルを含むベクトル (vector&lt;Mat&gt;) である。
        R_target2cam - ターゲット座標系で表された点をカメラ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{c}\textrm{T}_t\))。これは、キャリブレーションターゲット座標系からカメラ座標系へのすべての変換について、回転((3x3) 回転行列または (3x1) 回転ベクトル)を含むベクトル (vector&lt;Mat&gt;) である。
        t_target2cam - ターゲット座標系で表された点をカメラ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{c}\textrm{T}_t\))。これは、キャリブレーションターゲット座標系からカメラ座標系へのすべての変換について、(3x1) 並進ベクトルを含むベクトル (vector&lt;Mat&gt;) である。
        R_cam2gripper - カメラ座標系で表された点をグリッパ座標系へ変換する同次行列から抽出した、推定された (3x3) 回転部分 (\(_{}^{g}\textrm{T}_c\))。
        t_cam2gripper - カメラ座標系で表された点をグリッパ座標系へ変換する同次行列から抽出した、推定された (3x1) 並進部分 (\(_{}^{g}\textrm{T}_c\))。
        method - One of the implemented Hand-Eye calibration method, see cv::HandEyeCalibrationMethod The function performs the Hand-Eye calibration using various methods. One approach consists in estimating the rotation then the translation (separable solutions) and the following methods are implemented:
        • R. Tsai, R. Lenz A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/EyeCalibration \cite Tsai89
        • F. Park, B. Martin Robot Sensor Calibration: Solving AX = XB on the Euclidean Group \cite Park94
        • R. Horaud, F. Dornaika Hand-Eye Calibration \cite Horaud95
        Another approach consists in estimating simultaneously the rotation and the translation (simultaneous solutions), with the following implemented methods:
        • N. Andreff, R. Horaud, B. Espiau On-line Hand-Eye Calibration \cite Andreff99
        • K. Daniilidis Hand-Eye Calibration Using Dual Quaternions \cite Daniilidis98
        The following picture describes the Hand-Eye calibration problem where the transformation between a camera ("eye") mounted on a robot gripper ("hand") has to be estimated. This configuration is called eye-in-hand. The eye-to-hand configuration consists in a static camera observing a calibration pattern mounted on the robot end-effector. The transformation from the camera to the robot base frame can then be estimated by inputting the suitable transformations to the function, see below. ![](pics/hand-eye_figure.png) The calibration procedure is the following:
        • 静止したキャリブレーションパターンを用いて、ターゲットフレームとカメラフレームの間の変換を推定する
        • 複数の姿勢を取得するためにロボットのグリッパを動かす
        • 各姿勢について、グリッパ座標系とロボットベース座標系の間の同次変換が、たとえばロボットの運動学を用いて記録される \( \begin{bmatrix} X_b\\ Y_b\\ Z_b\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{b}\textrm{R}_g & _{}^{b}\textrm{t}_g \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_g\\ Y_g\\ Z_g\\ 1 \end{bmatrix} \)
        • 各姿勢について、キャリブレーションターゲット座標系とカメラ座標系の間の同次変換が、たとえば2D-3D点対応からの姿勢推定法 (PnP) を用いて記録される \( \begin{bmatrix} X_c\\ Y_c\\ Z_c\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{c}\textrm{R}_t & _{}^{c}\textrm{t}_t \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_t\\ Y_t\\ Z_t\\ 1 \end{bmatrix} \)
        The Hand-Eye calibration procedure returns the following homogeneous transformation \( \begin{bmatrix} X_g\\ Y_g\\ Z_g\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{g}\textrm{R}_c & _{}^{g}\textrm{t}_c \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_c\\ Y_c\\ Z_c\\ 1 \end{bmatrix} \) This problem is also known as solving the \(\mathbf{A}\mathbf{X}=\mathbf{X}\mathbf{B}\) equation:
        • eye-in-hand 構成の場合 \( \begin{align*} ^{b}{\textrm{T}_g}^{(1)} \hspace{0.2em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(1)} &= \hspace{0.1em} ^{b}{\textrm{T}_g}^{(2)} \hspace{0.2em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} \\
        (^{b}{\textrm{T}_g}^{(2)})^{-1} \hspace{0.2em} ^{b}{\textrm{T}_g}^{(1)} \hspace{0.2em} ^{g}\textrm{T}_c &= \hspace{0.1em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} (^{c}{\textrm{T}_t}^{(1)})^{-1} \\ \textrm{A}_i \textrm{X} &= \textrm{X} \textrm{B}_i \\ \end{align*} \)
        • eye-to-hand 構成の場合 \( \begin{align*} ^{g}{\textrm{T}_b}^{(1)} \hspace{0.2em} ^{b}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(1)} &= \hspace{0.1em} ^{g}{\textrm{T}_b}^{(2)} \hspace{0.2em} ^{b}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} \\
        (^{g}{\textrm{T}_b}^{(2)})^{-1} \hspace{0.2em} ^{g}{\textrm{T}_b}^{(1)} \hspace{0.2em} ^{b}\textrm{T}_c &= \hspace{0.1em} ^{b}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} (^{c}{\textrm{T}_t}^{(1)})^{-1} \\ \textrm{A}_i \textrm{X} &= \textrm{X} \textrm{B}_i \\ \end{align*} \) \note Additional information can be found on this [website](http://campar.in.tum.de/Chair/HandEyeCalibration). \note A minimum of 2 motions with non parallel rotation axes are necessary to determine the hand-eye transformation. So at least 3 different poses are required, but it is strongly recommended to use many more poses.
      • calibrateHandEye

        public static void calibrateHandEye​(java.util.List<Mat> R_gripper2base,
                                            java.util.List<Mat> t_gripper2base,
                                            java.util.List<Mat> R_target2cam,
                                            java.util.List<Mat> t_target2cam,
                                            Mat R_cam2gripper,
                                            Mat t_cam2gripper)
        Computes Hand-Eye calibration: \(_{}^{g}\textrm{T}_c\)
        引数:
        R_gripper2base - グリッパ座標系で表された点をロボットベース座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{b}\textrm{T}_g\))。これは、グリッパ座標系からロボットベース座標系へのすべての変換について、回転((3x3) 回転行列または (3x1) 回転ベクトル)を含むベクトル (vector&lt;Mat&gt;) である。
        t_gripper2base - グリッパ座標系で表された点をロボットベース座標系へ変換する同次行列から抽出した並進部分 (\(_{}^{b}\textrm{T}_g\))。これは、グリッパ座標系からロボットベース座標系へのすべての変換について、(3x1) 並進ベクトルを含むベクトル (vector&lt;Mat&gt;) である。
        R_target2cam - ターゲット座標系で表された点をカメラ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{c}\textrm{T}_t\))。これは、キャリブレーションターゲット座標系からカメラ座標系へのすべての変換について、回転((3x3) 回転行列または (3x1) 回転ベクトル)を含むベクトル (vector&lt;Mat&gt;) である。
        t_target2cam - ターゲット座標系で表された点をカメラ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{c}\textrm{T}_t\))。これは、キャリブレーションターゲット座標系からカメラ座標系へのすべての変換について、(3x1) 並進ベクトルを含むベクトル (vector&lt;Mat&gt;) である。
        R_cam2gripper - カメラ座標系で表された点をグリッパ座標系へ変換する同次行列から抽出した、推定された (3x3) 回転部分 (\(_{}^{g}\textrm{T}_c\))。
        t_cam2gripper - Estimated (3x1) translation part extracted from the homogeneous matrix that transforms a point expressed in the camera frame to the gripper frame (\(_{}^{g}\textrm{T}_c\)). The function performs the Hand-Eye calibration using various methods. One approach consists in estimating the rotation then the translation (separable solutions) and the following methods are implemented:
        • R. Tsai, R. Lenz A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/EyeCalibration \cite Tsai89
        • F. Park, B. Martin Robot Sensor Calibration: Solving AX = XB on the Euclidean Group \cite Park94
        • R. Horaud, F. Dornaika Hand-Eye Calibration \cite Horaud95
        Another approach consists in estimating simultaneously the rotation and the translation (simultaneous solutions), with the following implemented methods:
        • N. Andreff, R. Horaud, B. Espiau On-line Hand-Eye Calibration \cite Andreff99
        • K. Daniilidis Hand-Eye Calibration Using Dual Quaternions \cite Daniilidis98
        The following picture describes the Hand-Eye calibration problem where the transformation between a camera ("eye") mounted on a robot gripper ("hand") has to be estimated. This configuration is called eye-in-hand. The eye-to-hand configuration consists in a static camera observing a calibration pattern mounted on the robot end-effector. The transformation from the camera to the robot base frame can then be estimated by inputting the suitable transformations to the function, see below. ![](pics/hand-eye_figure.png) The calibration procedure is the following:
        • 静止したキャリブレーションパターンを用いて、ターゲットフレームとカメラフレームの間の変換を推定する
        • 複数の姿勢を取得するためにロボットのグリッパを動かす
        • 各姿勢について、グリッパ座標系とロボットベース座標系の間の同次変換が、たとえばロボットの運動学を用いて記録される \( \begin{bmatrix} X_b\\ Y_b\\ Z_b\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{b}\textrm{R}_g & _{}^{b}\textrm{t}_g \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_g\\ Y_g\\ Z_g\\ 1 \end{bmatrix} \)
        • 各姿勢について、キャリブレーションターゲット座標系とカメラ座標系の間の同次変換が、たとえば2D-3D点対応からの姿勢推定法 (PnP) を用いて記録される \( \begin{bmatrix} X_c\\ Y_c\\ Z_c\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{c}\textrm{R}_t & _{}^{c}\textrm{t}_t \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_t\\ Y_t\\ Z_t\\ 1 \end{bmatrix} \)
        The Hand-Eye calibration procedure returns the following homogeneous transformation \( \begin{bmatrix} X_g\\ Y_g\\ Z_g\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{g}\textrm{R}_c & _{}^{g}\textrm{t}_c \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_c\\ Y_c\\ Z_c\\ 1 \end{bmatrix} \) This problem is also known as solving the \(\mathbf{A}\mathbf{X}=\mathbf{X}\mathbf{B}\) equation:
        • eye-in-hand 構成の場合 \( \begin{align*} ^{b}{\textrm{T}_g}^{(1)} \hspace{0.2em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(1)} &= \hspace{0.1em} ^{b}{\textrm{T}_g}^{(2)} \hspace{0.2em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} \\
        (^{b}{\textrm{T}_g}^{(2)})^{-1} \hspace{0.2em} ^{b}{\textrm{T}_g}^{(1)} \hspace{0.2em} ^{g}\textrm{T}_c &= \hspace{0.1em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} (^{c}{\textrm{T}_t}^{(1)})^{-1} \\ \textrm{A}_i \textrm{X} &= \textrm{X} \textrm{B}_i \\ \end{align*} \)
        • eye-to-hand 構成の場合 \( \begin{align*} ^{g}{\textrm{T}_b}^{(1)} \hspace{0.2em} ^{b}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(1)} &= \hspace{0.1em} ^{g}{\textrm{T}_b}^{(2)} \hspace{0.2em} ^{b}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} \\
        (^{g}{\textrm{T}_b}^{(2)})^{-1} \hspace{0.2em} ^{g}{\textrm{T}_b}^{(1)} \hspace{0.2em} ^{b}\textrm{T}_c &= \hspace{0.1em} ^{b}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} (^{c}{\textrm{T}_t}^{(1)})^{-1} \\ \textrm{A}_i \textrm{X} &= \textrm{X} \textrm{B}_i \\ \end{align*} \) \note Additional information can be found on this [website](http://campar.in.tum.de/Chair/HandEyeCalibration). \note A minimum of 2 motions with non parallel rotation axes are necessary to determine the hand-eye transformation. So at least 3 different poses are required, but it is strongly recommended to use many more poses.
      • calibrateRobotWorldHandEye

        public static void calibrateRobotWorldHandEye​(java.util.List<Mat> R_world2cam,
                                                      java.util.List<Mat> t_world2cam,
                                                      java.util.List<Mat> R_base2gripper,
                                                      java.util.List<Mat> t_base2gripper,
                                                      Mat R_base2world,
                                                      Mat t_base2world,
                                                      Mat R_gripper2cam,
                                                      Mat t_gripper2cam,
                                                      int method)
        Computes Robot-World/Hand-Eye calibration: \(_{}^{w}\textrm{T}_b\) and \(_{}^{c}\textrm{T}_g\)
        引数:
        R_world2cam - ワールド座標系で表された点をカメラ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{c}\textrm{T}_w\))。これは、ワールド座標系からカメラ座標系へのすべての変換について、回転((3x3) 回転行列または (3x1) 回転ベクトル)を含むベクトル (vector&lt;Mat&gt;) である。
        t_world2cam - ワールド座標系で表された点をカメラ座標系へ変換する同次行列から抽出した並進部分 (\(_{}^{c}\textrm{T}_w\))。これは、ワールド座標系からカメラ座標系へのすべての変換について、(3x1) 並進ベクトルを含むベクトル (vector&lt;Mat&gt;) である。
        R_base2gripper - ロボットベース座標系で表された点をグリッパ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{g}\textrm{T}_b\))。これは、ロボットベース座標系からグリッパ座標系へのすべての変換について、回転((3x3) 回転行列または (3x1) 回転ベクトル)を含むベクトル (vector&lt;Mat&gt;) である。
        t_base2gripper - ロボットベース座標系で表された点をグリッパ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{g}\textrm{T}_b\))。これは、ロボットベース座標系からグリッパ座標系へのすべての変換について、(3x1) 並進ベクトルを含むベクトル (vector&lt;Mat&gt;) である。
        R_base2world - ロボットベース座標系で表された点をワールド座標系へ変換する同次行列から抽出した、推定された (3x3) 回転部分 (\(_{}^{w}\textrm{T}_b\))。
        t_base2world - ロボットベース座標系で表された点をワールド座標系へ変換する同次行列から抽出した、推定された (3x1) 並進部分 (\(_{}^{w}\textrm{T}_b\))。
        R_gripper2cam - グリッパ座標系で表された点をカメラ座標系へ変換する同次行列から抽出した、推定された (3x3) 回転部分 (\(_{}^{c}\textrm{T}_g\))。
        t_gripper2cam - グリッパ座標系で表された点をカメラ座標系へ変換する同次行列から抽出した、推定された (3x1) 並進部分 (\(_{}^{c}\textrm{T}_g\))。
        method - One of the implemented Robot-World/Hand-Eye calibration method, see cv::RobotWorldHandEyeCalibrationMethod The function performs the Robot-World/Hand-Eye calibration using various methods. One approach consists in estimating the rotation then the translation (separable solutions):
        • M. Shah, Solving the robot-world/hand-eye calibration problem using the kronecker product \cite Shah2013SolvingTR
        Another approach consists in estimating simultaneously the rotation and the translation (simultaneous solutions), with the following implemented method:
        • A. Li, L. Wang, and D. Wu, Simultaneous robot-world and hand-eye calibration using dual-quaternions and kronecker product \cite Li2010SimultaneousRA
        The following picture describes the Robot-World/Hand-Eye calibration problem where the transformations between a robot and a world frame and between a robot gripper ("hand") and a camera ("eye") mounted at the robot end-effector have to be estimated. ![](pics/robot-world_hand-eye_figure.png) The calibration procedure is the following:
        • 静止したキャリブレーションパターンを用いて、ターゲットフレームとカメラフレームの間の変換を推定する
        • 複数の姿勢を取得するためにロボットのグリッパを動かす
        • 各姿勢について、グリッパ座標系とロボットベース座標系の間の同次変換が、たとえばロボットの運動学を用いて記録される \( \begin{bmatrix} X_g\\ Y_g\\ Z_g\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{g}\textrm{R}_b & _{}^{g}\textrm{t}_b \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_b\\ Y_b\\ Z_b\\ 1 \end{bmatrix} \)
        • 各姿勢について、キャリブレーションターゲット座標系(ワールド座標系)とカメラ座標系の間の同次変換が、たとえば2D-3D点対応からの姿勢推定法 (PnP) を用いて記録される \( \begin{bmatrix} X_c\\ Y_c\\ Z_c\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{c}\textrm{R}_w & _{}^{c}\textrm{t}_w \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_w\\ Y_w\\ Z_w\\ 1 \end{bmatrix} \)
        The Robot-World/Hand-Eye calibration procedure returns the following homogeneous transformations \( \begin{bmatrix} X_w\\ Y_w\\ Z_w\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{w}\textrm{R}_b & _{}^{w}\textrm{t}_b \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_b\\ Y_b\\ Z_b\\ 1 \end{bmatrix} \) \( \begin{bmatrix} X_c\\ Y_c\\ Z_c\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{c}\textrm{R}_g & _{}^{c}\textrm{t}_g \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_g\\ Y_g\\ Z_g\\ 1 \end{bmatrix} \) This problem is also known as solving the \(\mathbf{A}\mathbf{X}=\mathbf{Z}\mathbf{B}\) equation, with:
        • \(\mathbf{A} \Leftrightarrow \hspace{0.1em} _{}^{c}\textrm{T}_w\)
        • \(\mathbf{X} \Leftrightarrow \hspace{0.1em} _{}^{w}\textrm{T}_b\)
        • \(\mathbf{Z} \Leftrightarrow \hspace{0.1em} _{}^{c}\textrm{T}_g\)
        • \(\mathbf{B} \Leftrightarrow \hspace{0.1em} _{}^{g}\textrm{T}_b\)
        \note At least 3 measurements are required (input vectors size must be greater or equal to 3).
      • calibrateRobotWorldHandEye

        public static void calibrateRobotWorldHandEye​(java.util.List<Mat> R_world2cam,
                                                      java.util.List<Mat> t_world2cam,
                                                      java.util.List<Mat> R_base2gripper,
                                                      java.util.List<Mat> t_base2gripper,
                                                      Mat R_base2world,
                                                      Mat t_base2world,
                                                      Mat R_gripper2cam,
                                                      Mat t_gripper2cam)
        Computes Robot-World/Hand-Eye calibration: \(_{}^{w}\textrm{T}_b\) and \(_{}^{c}\textrm{T}_g\)
        引数:
        R_world2cam - ワールド座標系で表された点をカメラ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{c}\textrm{T}_w\))。これは、ワールド座標系からカメラ座標系へのすべての変換について、回転((3x3) 回転行列または (3x1) 回転ベクトル)を含むベクトル (vector&lt;Mat&gt;) である。
        t_world2cam - ワールド座標系で表された点をカメラ座標系へ変換する同次行列から抽出した並進部分 (\(_{}^{c}\textrm{T}_w\))。これは、ワールド座標系からカメラ座標系へのすべての変換について、(3x1) 並進ベクトルを含むベクトル (vector&lt;Mat&gt;) である。
        R_base2gripper - ロボットベース座標系で表された点をグリッパ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{g}\textrm{T}_b\))。これは、ロボットベース座標系からグリッパ座標系へのすべての変換について、回転((3x3) 回転行列または (3x1) 回転ベクトル)を含むベクトル (vector&lt;Mat&gt;) である。
        t_base2gripper - ロボットベース座標系で表された点をグリッパ座標系へ変換する同次行列から抽出した回転部分 (\(_{}^{g}\textrm{T}_b\))。これは、ロボットベース座標系からグリッパ座標系へのすべての変換について、(3x1) 並進ベクトルを含むベクトル (vector&lt;Mat&gt;) である。
        R_base2world - ロボットベース座標系で表された点をワールド座標系へ変換する同次行列から抽出した、推定された (3x3) 回転部分 (\(_{}^{w}\textrm{T}_b\))。
        t_base2world - ロボットベース座標系で表された点をワールド座標系へ変換する同次行列から抽出した、推定された (3x1) 並進部分 (\(_{}^{w}\textrm{T}_b\))。
        R_gripper2cam - グリッパ座標系で表された点をカメラ座標系へ変換する同次行列から抽出した、推定された (3x3) 回転部分 (\(_{}^{c}\textrm{T}_g\))。
        t_gripper2cam - Estimated (3x1) translation part extracted from the homogeneous matrix that transforms a point expressed in the gripper frame to the camera frame (\(_{}^{c}\textrm{T}_g\)). The function performs the Robot-World/Hand-Eye calibration using various methods. One approach consists in estimating the rotation then the translation (separable solutions):
        • M. Shah, Solving the robot-world/hand-eye calibration problem using the kronecker product \cite Shah2013SolvingTR
        Another approach consists in estimating simultaneously the rotation and the translation (simultaneous solutions), with the following implemented method:
        • A. Li, L. Wang, and D. Wu, Simultaneous robot-world and hand-eye calibration using dual-quaternions and kronecker product \cite Li2010SimultaneousRA
        The following picture describes the Robot-World/Hand-Eye calibration problem where the transformations between a robot and a world frame and between a robot gripper ("hand") and a camera ("eye") mounted at the robot end-effector have to be estimated. ![](pics/robot-world_hand-eye_figure.png) The calibration procedure is the following:
        • 静止したキャリブレーションパターンを用いて、ターゲットフレームとカメラフレームの間の変換を推定する
        • 複数の姿勢を取得するためにロボットのグリッパを動かす
        • 各姿勢について、グリッパ座標系とロボットベース座標系の間の同次変換が、たとえばロボットの運動学を用いて記録される \( \begin{bmatrix} X_g\\ Y_g\\ Z_g\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{g}\textrm{R}_b & _{}^{g}\textrm{t}_b \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_b\\ Y_b\\ Z_b\\ 1 \end{bmatrix} \)
        • 各姿勢について、キャリブレーションターゲット座標系(ワールド座標系)とカメラ座標系の間の同次変換が、たとえば2D-3D点対応からの姿勢推定法 (PnP) を用いて記録される \( \begin{bmatrix} X_c\\ Y_c\\ Z_c\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{c}\textrm{R}_w & _{}^{c}\textrm{t}_w \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_w\\ Y_w\\ Z_w\\ 1 \end{bmatrix} \)
        The Robot-World/Hand-Eye calibration procedure returns the following homogeneous transformations \( \begin{bmatrix} X_w\\ Y_w\\ Z_w\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{w}\textrm{R}_b & _{}^{w}\textrm{t}_b \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_b\\ Y_b\\ Z_b\\ 1 \end{bmatrix} \) \( \begin{bmatrix} X_c\\ Y_c\\ Z_c\\ 1 \end{bmatrix} = \begin{bmatrix} _{}^{c}\textrm{R}_g & _{}^{c}\textrm{t}_g \\ 0_{1 \times 3} & 1 \end{bmatrix} \begin{bmatrix} X_g\\ Y_g\\ Z_g\\ 1 \end{bmatrix} \) This problem is also known as solving the \(\mathbf{A}\mathbf{X}=\mathbf{Z}\mathbf{B}\) equation, with:
        • \(\mathbf{A} \Leftrightarrow \hspace{0.1em} _{}^{c}\textrm{T}_w\)
        • \(\mathbf{X} \Leftrightarrow \hspace{0.1em} _{}^{w}\textrm{T}_b\)
        • \(\mathbf{Z} \Leftrightarrow \hspace{0.1em} _{}^{c}\textrm{T}_g\)
        • \(\mathbf{B} \Leftrightarrow \hspace{0.1em} _{}^{g}\textrm{T}_b\)
        \note At least 3 measurements are required (input vectors size must be greater or equal to 3).
      • convertPointsToHomogeneous

        public static void convertPointsToHomogeneous​(Mat src,
                                                      Mat dst)
        Converts points from Euclidean to homogeneous space.
        引数:
        src - N次元の点の入力ベクトル。
        dst - N+1次元の点の出力ベクトル。この関数は、点座標のタプルに1を付加することで、点をユークリッド空間から同次空間へ変換する。すなわち、各点 (x1, x2, ..., xn) は (x1, x2, ..., xn, 1) へ変換される。
      • convertPointsFromHomogeneous

        public static void convertPointsFromHomogeneous​(Mat src,
                                                        Mat dst)
        Converts points from homogeneous to Euclidean space.
        引数:
        src - N次元の点の入力ベクトル。
        dst - N-1次元の点の出力ベクトル。この関数は、透視投影を用いて点を同次空間からユークリッド空間へ変換する。すなわち、各点 (x1, x2, ... x(n-1), xn) は (x1/xn, x2/xn, ..., x(n-1)/xn) へ変換される。xn=0 の場合、出力点の座標は (0,0,0,...) となる。
      • findFundamentalMat

        public static Mat findFundamentalMat​(MatOfPoint2f points1,
                                             MatOfPoint2f points2,
                                             int method,
                                             double ransacReprojThreshold,
                                             double confidence,
                                             int maxIters,
                                             Mat mask)
        Calculates a fundamental matrix from the corresponding points in two images.
        引数:
        points1 - 1枚目の画像のN個の点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        method - Method for computing a fundamental matrix.
        • REF: FM_7POINT は7点アルゴリズム。 \(N = 7\)
        • REF: FM_8POINT は8点アルゴリズム。 \(N \ge 8\)
        • REF: FM_RANSAC はRANSACアルゴリズム。 \(N \ge 8\)
        • REF: FM_LMEDS はLMedSアルゴリズム。 \(N \ge 8\)
        ransacReprojThreshold - RANSACでのみ使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。
        confidence - RANSACおよびLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        mask - 省略可能な出力マスク
        maxIters - ロバスト手法の最大反復回数。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T F [p_1; 1] = 0\) ここで \(F\) は基礎行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数は上記の4つの手法のいずれかを用いて基礎行列を計算し、求めた基礎行列を返す。通常は1つの行列のみが求まる。ただし7点アルゴリズムの場合、この関数は最大3つの解を返すことがある(3つの行列を順に格納した \(9 \times 3\) 行列)。計算された基礎行列は、指定した点に対応するエピポーラ線を求める #computeCorrespondEpilines にさらに渡すことができる。また、平行化変換を計算する #stereoRectifyUncalibrated に渡すこともできる。 : // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } Mat fundamental_matrix = findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);
        戻り値:
        自動生成
      • findFundamentalMat

        public static Mat findFundamentalMat​(MatOfPoint2f points1,
                                             MatOfPoint2f points2,
                                             int method,
                                             double ransacReprojThreshold,
                                             double confidence,
                                             int maxIters)
        Calculates a fundamental matrix from the corresponding points in two images.
        引数:
        points1 - 1枚目の画像のN個の点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        method - Method for computing a fundamental matrix.
        • REF: FM_7POINT は7点アルゴリズム。 \(N = 7\)
        • REF: FM_8POINT は8点アルゴリズム。 \(N \ge 8\)
        • REF: FM_RANSAC はRANSACアルゴリズム。 \(N \ge 8\)
        • REF: FM_LMEDS はLMedSアルゴリズム。 \(N \ge 8\)
        ransacReprojThreshold - RANSACでのみ使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。
        confidence - RANSACおよびLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        maxIters - ロバスト手法の最大反復回数。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T F [p_1; 1] = 0\) ここで \(F\) は基礎行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数は上記の4つの手法のいずれかを用いて基礎行列を計算し、求めた基礎行列を返す。通常は1つの行列のみが求まる。ただし7点アルゴリズムの場合、この関数は最大3つの解を返すことがある(3つの行列を順に格納した \(9 \times 3\) 行列)。計算された基礎行列は、指定した点に対応するエピポーラ線を求める #computeCorrespondEpilines にさらに渡すことができる。また、平行化変換を計算する #stereoRectifyUncalibrated に渡すこともできる。 : // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } Mat fundamental_matrix = findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);
        戻り値:
        自動生成
      • findFundamentalMat

        public static Mat findFundamentalMat​(MatOfPoint2f points1,
                                             MatOfPoint2f points2,
                                             int method,
                                             double ransacReprojThreshold,
                                             double confidence,
                                             Mat mask)
      • findFundamentalMat

        public static Mat findFundamentalMat​(MatOfPoint2f points1,
                                             MatOfPoint2f points2,
                                             int method,
                                             double ransacReprojThreshold,
                                             double confidence)
      • findFundamentalMat

        public static Mat findFundamentalMat​(MatOfPoint2f points1,
                                             MatOfPoint2f points2,
                                             int method,
                                             double ransacReprojThreshold)
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix,
                                           int method,
                                           double prob,
                                           double threshold,
                                           int maxIters,
                                           Mat mask)
        Calculates an essential matrix from the corresponding points in two images.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについて P = cv::NoArray() を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。
        mask - N個の要素からなる出力配列。各要素は外れ値に対して0、それ以外の点に対して1が設定される。この配列はRANSACおよびLMedS法でのみ計算される。
        maxIters - ロバスト手法の最大反復回数。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix,
                                           int method,
                                           double prob,
                                           double threshold,
                                           int maxIters)
        Calculates an essential matrix from the corresponding points in two images.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについて P = cv::NoArray() を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。
        maxIters - ロバスト手法の最大反復回数。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix,
                                           int method,
                                           double prob,
                                           double threshold)
        Calculates an essential matrix from the corresponding points in two images.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについて P = cv::NoArray() を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix,
                                           int method,
                                           double prob)
        Calculates an essential matrix from the corresponding points in two images.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについて P = cv::NoArray() を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix,
                                           int method)
        Calculates an essential matrix from the corresponding points in two images.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについて P = cv::NoArray() を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        confidence (probability) that the estimated matrix is correct. line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. for the other points. The array is computed only in the RANSAC and LMedS methods. This function estimates essential matrix based on the five-point algorithm solver in CITE: Nister03 . CITE: SteweniusCFS is also a related. The epipolar geometry is described by the following equation: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) where \(E\) is an essential matrix, \(p_1\) and \(p_2\) are corresponding points in the first and the second images, respectively. The result of this function may be passed further to #decomposeEssentialMat or #recoverPose to recover the relative pose between cameras.
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix)
        Calculates an essential matrix from the corresponding points in two images.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - Camera intrinsic matrix \(\cameramatrix{A}\) . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera intrinsic matrix. If this assumption does not hold for your use case, use another function overload or #undistortPoints with P = cv::NoArray() for both cameras to transform image points to normalized image coordinates, which are valid for the identity camera intrinsic matrix. When passing these coordinates, pass the identity matrix for this parameter.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        confidence (probability) that the estimated matrix is correct. line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. for the other points. The array is computed only in the RANSAC and LMedS methods. This function estimates essential matrix based on the five-point algorithm solver in CITE: Nister03 . CITE: SteweniusCFS is also a related. The epipolar geometry is described by the following equation: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) where \(E\) is an essential matrix, \(p_1\) and \(p_2\) are corresponding points in the first and the second images, respectively. The result of this function may be passed further to #decomposeEssentialMat or #recoverPose to recover the relative pose between cameras.
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           double focal,
                                           Point pp,
                                           int method,
                                           double prob,
                                           double threshold,
                                           int maxIters,
                                           Mat mask)
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。
        pp - カメラの主点。
        method - Method for computing a fundamental matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        mask - N個の要素からなる出力配列。各要素は外れ値に対して0、それ以外の点に対して1が設定される。この配列はRANSACおよびLMedS法でのみ計算される。
        maxIters - ロバスト手法の最大反復回数。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           double focal,
                                           Point pp,
                                           int method,
                                           double prob,
                                           double threshold,
                                           int maxIters)
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。
        pp - カメラの主点。
        method - Method for computing a fundamental matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。
        maxIters - ロバスト手法の最大反復回数。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           double focal,
                                           Point pp,
                                           int method,
                                           double prob,
                                           double threshold)
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。
        pp - カメラの主点。
        method - Method for computing a fundamental matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           double focal,
                                           Point pp,
                                           int method,
                                           double prob)
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。
        pp - カメラの主点。
        method - Method for computing a fundamental matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise.
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           double focal,
                                           Point pp,
                                           int method)
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。
        pp - カメラの主点。
        method - Method for computing a fundamental matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. confidence (probability) that the estimated matrix is correct. for the other points. The array is computed only in the RANSAC and LMedS methods. This function differs from the one above that it computes camera intrinsic matrix from focal length and principal point: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           double focal,
                                           Point pp)
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。
        pp - principal point of the camera.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. confidence (probability) that the estimated matrix is correct. for the other points. The array is computed only in the RANSAC and LMedS methods. This function differs from the one above that it computes camera intrinsic matrix from focal length and principal point: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           double focal)
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        focal - focal length of the camera. Note that this function assumes that points1 and points2 are feature points from cameras with same focal length and principal point.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. confidence (probability) that the estimated matrix is correct. for the other points. The array is computed only in the RANSAC and LMedS methods. This function differs from the one above that it computes camera intrinsic matrix from focal length and principal point: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2)
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - Array of the second image points of the same size and format as points1 . are feature points from cameras with same focal length and principal point.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. confidence (probability) that the estimated matrix is correct. for the other points. The array is computed only in the RANSAC and LMedS methods. This function differs from the one above that it computes camera intrinsic matrix from focal length and principal point: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix1,
                                           Mat distCoeffs1,
                                           Mat cameraMatrix2,
                                           Mat distCoeffs2,
                                           int method,
                                           double prob,
                                           double threshold,
                                           Mat mask)
        Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        cameraMatrix2 - 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs1 - 1台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        distCoeffs2 - 2台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。
        mask - N個の要素からなる出力配列。各要素は外れ値に対して0、それ以外の点に対して1が設定される。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix1,
                                           Mat distCoeffs1,
                                           Mat cameraMatrix2,
                                           Mat distCoeffs2,
                                           int method,
                                           double prob,
                                           double threshold)
        Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        cameraMatrix2 - 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs1 - 1台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        distCoeffs2 - 2台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix1,
                                           Mat distCoeffs1,
                                           Mat cameraMatrix2,
                                           Mat distCoeffs2,
                                           int method,
                                           double prob)
        Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        cameraMatrix2 - 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs1 - 1台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        distCoeffs2 - 2台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix1,
                                           Mat distCoeffs1,
                                           Mat cameraMatrix2,
                                           Mat distCoeffs2,
                                           int method)
        Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        cameraMatrix2 - 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs1 - 1台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        distCoeffs2 - 2台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        confidence (probability) that the estimated matrix is correct. line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. for the other points. The array is computed only in the RANSAC and LMedS methods. This function estimates essential matrix based on the five-point algorithm solver in CITE: Nister03 . CITE: SteweniusCFS is also a related. The epipolar geometry is described by the following equation: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) where \(E\) is an essential matrix, \(p_1\) and \(p_2\) are corresponding points in the first and the second images, respectively. The result of this function may be passed further to #decomposeEssentialMat or #recoverPose to recover the relative pose between cameras.
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix1,
                                           Mat distCoeffs1,
                                           Mat cameraMatrix2,
                                           Mat distCoeffs2)
        Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.
        引数:
        points1 - 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        cameraMatrix2 - 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs1 - 1台目のカメラの歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。
        distCoeffs2 - Input vector of distortion coefficients for the second camera \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        confidence (probability) that the estimated matrix is correct. line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. for the other points. The array is computed only in the RANSAC and LMedS methods. This function estimates essential matrix based on the five-point algorithm solver in CITE: Nister03 . CITE: SteweniusCFS is also a related. The epipolar geometry is described by the following equation: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) where \(E\) is an essential matrix, \(p_1\) and \(p_2\) are corresponding points in the first and the second images, respectively. The result of this function may be passed further to #decomposeEssentialMat or #recoverPose to recover the relative pose between cameras.
        戻り値:
        自動生成
      • findEssentialMat

        public static Mat findEssentialMat​(Mat points1,
                                           Mat points2,
                                           Mat cameraMatrix1,
                                           Mat cameraMatrix2,
                                           Mat dist_coeff1,
                                           Mat dist_coeff2,
                                           Mat mask,
                                           UsacParams params)
      • decomposeEssentialMat

        public static void decomposeEssentialMat​(Mat E,
                                                 Mat R1,
                                                 Mat R2,
                                                 Mat t)
        Decompose an essential matrix to possible rotations and translation.
        引数:
        E - 入力の基本行列。
        R1 - 可能な回転行列の1つ。
        R2 - もう1つの可能な回転行列。
        t - 可能な並進の1つ。この関数は、SVD分解 CITE: HartleyZ00 を用いて基本行列 E を分解する。一般に、E の分解には4つの可能な姿勢が存在する。それらは \([R_1, t]\), \([R_1, -t]\), \([R_2, t]\), \([R_2, -t]\) である。E が1枚目の画像内の画像点 \(p_1\) と2枚目の画像内の \(p_2\) の間にエピポーラ制約 \([p_2; 1]^T A^{-T} E A^{-1} [p_1; 1] = 0\) を与える場合、組 \([R_1, t]\), \([R_1, -t]\), \([R_2, t]\), \([R_2, -t]\) のいずれかが1台目のカメラ座標系から2台目のカメラ座標系への基底変換となる。ただし、E を分解しても並進の方向しか得られない。このため、並進 t は単位長で返される。
      • recoverPose

        public static int recoverPose​(Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix1,
                                      Mat distCoeffs1,
                                      Mat cameraMatrix2,
                                      Mat distCoeffs2,
                                      Mat E,
                                      Mat R,
                                      Mat t,
                                      int method,
                                      double prob,
                                      double threshold,
                                      Mat mask)
        Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using cheirality check. Returns the number of inliers that pass the check.
        引数:
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs1 - 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。
        cameraMatrix2 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs2 - 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。
        E - 出力の基本行列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。
        mask - points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、cheirality(可視性)チェックを通過した内点のみが含まれる。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、cheirality チェックを行うことで可能な姿勢の仮説を検証する。cheirality チェックとは、三角測量された3D点のビット深度が正である必要があることを意味する。詳細は CITE: Nister03 を参照。この関数は、 REF: findEssentialMat の出力 E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は findEssentialMat に対する入力と同じである。: // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix1,
                                      Mat distCoeffs1,
                                      Mat cameraMatrix2,
                                      Mat distCoeffs2,
                                      Mat E,
                                      Mat R,
                                      Mat t,
                                      int method,
                                      double prob,
                                      double threshold)
        Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using cheirality check. Returns the number of inliers that pass the check.
        引数:
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs1 - 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。
        cameraMatrix2 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs2 - 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。
        E - 出力の基本行列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。
        threshold - RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、cheirality チェックを通過した内点のみが含まれる。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、cheirality チェックを行うことで可能な姿勢の仮説を検証する。cheirality チェックとは、三角測量された3D点のビット深度が正である必要があることを意味する。詳細は CITE: Nister03 を参照。この関数は、 REF: findEssentialMat の出力 E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は findEssentialMat に対する入力と同じである。: // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix1,
                                      Mat distCoeffs1,
                                      Mat cameraMatrix2,
                                      Mat distCoeffs2,
                                      Mat E,
                                      Mat R,
                                      Mat t,
                                      int method,
                                      double prob)
        Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using cheirality check. Returns the number of inliers that pass the check.
        引数:
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs1 - 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。
        cameraMatrix2 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs2 - 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。
        E - 出力の基本行列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        prob - RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、cheirality チェックを通過した内点のみが含まれる。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、cheirality チェックを行うことで可能な姿勢の仮説を検証する。cheirality チェックとは、三角測量された3D点のビット深度が正である必要があることを意味する。詳細は CITE: Nister03 を参照。この関数は、 REF: findEssentialMat の出力 E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は findEssentialMat に対する入力と同じである。: // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix1,
                                      Mat distCoeffs1,
                                      Mat cameraMatrix2,
                                      Mat distCoeffs2,
                                      Mat E,
                                      Mat R,
                                      Mat t,
                                      int method)
        Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using cheirality check. Returns the number of inliers that pass the check.
        引数:
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs1 - 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。
        cameraMatrix2 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs2 - 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。
        E - 出力の基本行列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        method - Method for computing an essential matrix.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        confidence (probability) that the estimated matrix is correct. line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. inliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to recover pose. In the output mask only inliers which pass the cheirality check. This function decomposes an essential matrix using REF: decomposeEssentialMat and then verifies possible pose hypotheses by doing cheirality check. The cheirality check means that the triangulated 3D points should have positive depth. Some details can be found in CITE: Nister03. This function can be used to process the output E and mask from REF: findEssentialMat. In this scenario, points1 and points2 are the same input for findEssentialMat.: // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix1,
                                      Mat distCoeffs1,
                                      Mat cameraMatrix2,
                                      Mat distCoeffs2,
                                      Mat E,
                                      Mat R,
                                      Mat t)
        Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using cheirality check. Returns the number of inliers that pass the check.
        引数:
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix1 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs1 - 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。
        cameraMatrix2 - 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。
        distCoeffs2 - 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。
        E - 出力の基本行列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。
        t - Output translation vector. This vector is obtained by REF: decomposeEssentialMat and therefore is only known up to scale, i.e. t is the direction of the translation vector and has unit length.
        • REF: RANSAC はRANSACアルゴリズム。
        • REF: LMEDS はLMedSアルゴリズム。
        confidence (probability) that the estimated matrix is correct. line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. inliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to recover pose. In the output mask only inliers which pass the cheirality check. This function decomposes an essential matrix using REF: decomposeEssentialMat and then verifies possible pose hypotheses by doing cheirality check. The cheirality check means that the triangulated 3D points should have positive depth. Some details can be found in CITE: Nister03. This function can be used to process the output E and mask from REF: findEssentialMat. In this scenario, points1 and points2 are the same input for findEssentialMat.: // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix,
                                      Mat R,
                                      Mat t,
                                      Mat mask)
        Recovers the relative camera rotation and the translation from an estimated essential matrix and the corresponding points in two images, using chirality check. Returns the number of inliers that pass the check.
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        mask - points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality(可視性)チェックを通過した内点のみが含まれる。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、chirality チェックを行うことで可能な姿勢の仮説を検証する。chirality チェックとは、三角測量された3D点のビット深度が正である必要があることを意味する。詳細は CITE: Nister03 を参照。この関数は、 REF: findEssentialMat の出力 E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は #findEssentialMat に対する入力と同じである : // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } // cametra matrix with both focal lengths = 1, and principal point = (0, 0) Mat cameraMatrix = Mat::eye(3, 3, CV_64F); Mat E, R, t, mask; E = findEssentialMat(points1, points2, cameraMatrix, RANSAC, 0.999, 1.0, mask); recoverPose(E, points1, points2, cameraMatrix, R, t, mask);
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix,
                                      Mat R,
                                      Mat t)
        Recovers the relative camera rotation and the translation from an estimated essential matrix and the corresponding points in two images, using chirality check. Returns the number of inliers that pass the check.
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、chirality チェックを行うことで可能な姿勢の仮説を検証する。chirality チェックとは、三角測量された3D点のビット深度が正である必要があることを意味する。詳細は CITE: Nister03 を参照。この関数は、 REF: findEssentialMat の出力 E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は #findEssentialMat に対する入力と同じである : // Example. Estimation of fundamental matrix using the RANSAC algorithm int point_count = 100; vector<Point2f> points1(point_count); vector<Point2f> points2(point_count); // initialize the points here ... for( int i = 0; i < point_count; i++ ) { points1[i] = ...; points2[i] = ...; } // cametra matrix with both focal lengths = 1, and principal point = (0, 0) Mat cameraMatrix = Mat::eye(3, 3, CV_64F); Mat E, R, t, mask; E = findEssentialMat(points1, points2, cameraMatrix, RANSAC, 0.999, 1.0, mask); recoverPose(E, points1, points2, cameraMatrix, R, t, mask);
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat R,
                                      Mat t,
                                      double focal,
                                      Point pp,
                                      Mat mask)
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。
        pp - カメラの主点。
        mask - points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat R,
                                      Mat t,
                                      double focal,
                                      Point pp)
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。
        pp - カメラの主点。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat R,
                                      Mat t,
                                      double focal)
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        focal - カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat R,
                                      Mat t)
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。同じ焦点距離と主点を持つカメラからの特徴点である。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix,
                                      Mat R,
                                      Mat t,
                                      double distanceThresh,
                                      Mat mask,
                                      Mat triangulatedPoints)
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        distanceThresh - 遠方の点(すなわち無限遠の点)を除外するために使用されるしきい値距離。
        mask - points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。
        triangulatedPoints - 三角測量によって再構成された3D点。この関数は、chirality チェックに使用される三角測量された3D点を出力する点で前述の関数と異なる。
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix,
                                      Mat R,
                                      Mat t,
                                      double distanceThresh,
                                      Mat mask)
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        distanceThresh - 遠方の点(すなわち無限遠の点)を除外するために使用されるしきい値距離。
        mask - points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、chirality チェックに使用される三角測量された3D点を出力する点で前述の関数と異なる。
        戻り値:
        自動生成
      • recoverPose

        public static int recoverPose​(Mat E,
                                      Mat points1,
                                      Mat points2,
                                      Mat cameraMatrix,
                                      Mat R,
                                      Mat t,
                                      double distanceThresh)
        引数:
        E - 入力の基本行列。
        points1 - 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。
        points2 - points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。
        cameraMatrix - カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。
        R - 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。
        t - 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。
        distanceThresh - 遠方の点(すなわち無限遠の点)を除外するために使用されるしきい値距離。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、chirality チェックに使用される三角測量された3D点を出力する点で前述の関数と異なる。
        戻り値:
        自動生成
      • computeCorrespondEpilines

        public static void computeCorrespondEpilines​(Mat points,
                                                     int whichImage,
                                                     Mat F,
                                                     Mat lines)
        For points in an image of a stereo pair, computes the corresponding epilines in the other image.
        引数:
        points - 入力点。CV_32FC2型または vector<Point2f> の \(N \times 1\) または \(1 \times N\) 行列。
        whichImage - 点を含む画像(1または2)のインデックス。
        F - #findFundamentalMat または #stereoRectify を使って推定できる基礎行列。
        lines - もう一方の画像内の点に対応するエピポーラ線の出力ベクトル。各線 \(ax + by + c=0\) は3つの数 \((a, b, c)\) で符号化される。ステレオペアの2枚の画像のうち一方の画像内の各点について、この関数はもう一方の画像内の対応するエピポーラ線の方程式を求める。基礎行列の定義(#findFundamentalMat を参照)から、1枚目の画像内の点 \(p^{(1)}_i\) に対する2枚目の画像内の線 \(l^{(2)}_i\) は(whichImage=1 のとき)次のように計算される: \(l^{(2)}_i = F p^{(1)}_i\) 逆に、whichImage=2 のとき、 \(l^{(1)}_i\) は \(p^{(2)}_i\) から次のように計算される: \(l^{(1)}_i = F^T p^{(2)}_i\) 線の係数はスケールを除いて定義される。それらは \(a_i^2+b_i^2=1\) となるように正規化される。
      • triangulatePoints

        public static void triangulatePoints​(Mat projMatr1,
                                             Mat projMatr2,
                                             Mat projPoints1,
                                             Mat projPoints2,
                                             Mat points4D)
        This function reconstructs 3-dimensional points (in homogeneous coordinates) by using their observations with a stereo camera.
        引数:
        projMatr1 - 1台目のカメラの3x4射影行列。すなわち、この行列はワールド座標系で与えられた3D点を1枚目の画像へ射影する。
        projMatr2 - 2台目のカメラの3x4射影行列。すなわち、この行列はワールド座標系で与えられた3D点を2枚目の画像へ射影する。
        projPoints1 - 1枚目の画像内の特徴点の2xN配列。C++版の場合、特徴点のベクトルや、サイズ1xNまたはNx1の2チャンネル行列とすることもできる。
        projPoints2 - 2枚目の画像内の対応点の2xN配列。C++版の場合、特徴点のベクトルや、サイズ1xNまたはNx1の2チャンネル行列とすることもできる。
        points4D - 同次座標で再構成された点の4xN配列。これらの点はワールド座標系で返される。注意: この関数が動作するためには、すべての入力データが浮動小数点型である必要がある点に留意すること。注意: REF: stereoRectify の射影行列を使用した場合、返される点は1台目のカメラの平行化された座標系で表現される。SEE: reprojectImageTo3D
      • correctMatches

        public static void correctMatches​(Mat F,
                                          Mat points1,
                                          Mat points2,
                                          Mat newPoints1,
                                          Mat newPoints2)
        Refines coordinates of corresponding points.
        引数:
        F - 3x3の基礎行列。
        points1 - 1番目の点群を含む1xN配列。
        points2 - 2番目の点群を含む1xN配列。
        newPoints1 - 最適化された points1。
        newPoints2 - 最適化された points2。この関数は最適三角測量法(Optimal Triangulation Method)を実装している(詳細は Multiple View Geometry CITE: HartleyZ00 を参照)。与えられた各点対応 points1[i] <-> points2[i] と基礎行列 F に対して、エピポーラ制約 \(newPoints2^T \cdot F \cdot newPoints1 = 0\) を満たしつつ、幾何誤差 \(d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2\) (ここで \(d(a,b)\) は点 \(a\) と \(b\) 間の幾何距離)を最小化する補正された対応 newPoints1[i] <-> newPoints2[i] を計算する。
      • filterSpeckles

        public static void filterSpeckles​(Mat img,
                                          double newVal,
                                          int maxSpeckleSize,
                                          double maxDiff,
                                          Mat buf)
        Filters off small noise blobs (speckles) in the disparity map
        引数:
        img - 入力となる16ビット符号付きの視差画像
        newVal - スペックルを塗りつぶすために使用する視差値
        maxSpeckleSize - スペックルとみなす最大のスペックルサイズ。これより大きいブロブはアルゴリズムの影響を受けない
        maxDiff - 隣接する視差ピクセルを同じブロブにまとめる際の最大差分。StereoBM、StereoSGBM、そしておそらく他のアルゴリズムは、視差値が16倍された固定小数点形式の視差マップを返すため、この引数の値を指定する際にはこのスケール係数を考慮する必要があることに注意。
        buf - 関数内でのメモリ確保を避けるための省略可能な一時バッファ。
      • filterSpeckles

        public static void filterSpeckles​(Mat img,
                                          double newVal,
                                          int maxSpeckleSize,
                                          double maxDiff)
        Filters off small noise blobs (speckles) in the disparity map
        引数:
        img - 入力となる16ビット符号付きの視差画像
        newVal - スペックルを塗りつぶすために使用する視差値
        maxSpeckleSize - スペックルとみなす最大のスペックルサイズ。これより大きいブロブはアルゴリズムの影響を受けない
        maxDiff - 隣接する視差ピクセルを同じブロブにまとめる際の最大差分。StereoBM、StereoSGBM、そしておそらく他のアルゴリズムは、視差値が16倍された固定小数点形式の視差マップを返すため、この引数の値を指定する際にはこのスケール係数を考慮する必要があることに注意。
      • getValidDisparityROI

        public static Rect getValidDisparityROI​(Rect roi1,
                                                Rect roi2,
                                                int minDisparity,
                                                int numberOfDisparities,
                                                int blockSize)
      • validateDisparity

        public static void validateDisparity​(Mat disparity,
                                             Mat cost,
                                             int minDisparity,
                                             int numberOfDisparities,
                                             int disp12MaxDisp)
      • validateDisparity

        public static void validateDisparity​(Mat disparity,
                                             Mat cost,
                                             int minDisparity,
                                             int numberOfDisparities)
      • reprojectImageTo3D

        public static void reprojectImageTo3D​(Mat disparity,
                                              Mat _3dImage,
                                              Mat Q,
                                              boolean handleMissingValues,
                                              int ddepth)
        Reprojects a disparity image to 3D space.
        引数:
        disparity - 入力となるシングルチャンネルの8ビット符号なし、16ビット符号付き、32ビット符号付き、または32ビット浮動小数点の視差画像。8ビット/16ビット符号付き形式の値は小数部を持たないものとみなされる。視差がREF: StereoBM や REF: StereoSGBM、あるいは他のアルゴリズムで計算された16ビット符号付き形式の場合、ここで使用する前に16で割る必要がある(そしてfloatにスケーリングする)。
        _3dImage - disparityと同じサイズの3チャンネル浮動小数点出力画像。_3dImage(x,y)の各要素には、視差マップから計算された点(x,y)の3次元座標が格納される。REF: stereoRectify で得られたQを使用した場合、返される点は1台目のカメラの平行化座標系で表現される。
        Q - REF: stereoRectify で得られる \(4 \times 4\) の透視変換行列。
        handleMissingValues - 関数が欠損値(すなわち視差が計算されなかった点)を処理すべきかどうかを示す。handleMissingValues=true の場合、外れ値に対応する最小視差を持つピクセル(StereoMatcher::compute を参照)は、非常に大きなZ値(現在は10000に設定)を持つ3次元点に変換される。
        ddepth - 省略可能な出力配列のビット深度。-1の場合、出力画像はCV_32Fのビット深度になる。ddepthはCV_16S、CV_32S、CV_32Fに設定することもできる。この関数はシングルチャンネルの視差マップを、3次元曲面を表す3チャンネル画像に変換する。すなわち、各ピクセル(x,y)と対応する視差 d=disparity(x,y) に対して、次を計算する: \(\begin{bmatrix} X \\ Y \\ Z \\ W \end{bmatrix} = Q \begin{bmatrix} x \\ y \\ \texttt{disparity} (x,y) \\ 1 \end{bmatrix}.\) SEE: 疎な点集合 {(x,y,d),...} を3次元空間に再投影するには、perspectiveTransform を使用する。
      • reprojectImageTo3D

        public static void reprojectImageTo3D​(Mat disparity,
                                              Mat _3dImage,
                                              Mat Q,
                                              boolean handleMissingValues)
        Reprojects a disparity image to 3D space.
        引数:
        disparity - 入力となるシングルチャンネルの8ビット符号なし、16ビット符号付き、32ビット符号付き、または32ビット浮動小数点の視差画像。8ビット/16ビット符号付き形式の値は小数部を持たないものとみなされる。視差がREF: StereoBM や REF: StereoSGBM、あるいは他のアルゴリズムで計算された16ビット符号付き形式の場合、ここで使用する前に16で割る必要がある(そしてfloatにスケーリングする)。
        _3dImage - disparityと同じサイズの3チャンネル浮動小数点出力画像。_3dImage(x,y)の各要素には、視差マップから計算された点(x,y)の3次元座標が格納される。REF: stereoRectify で得られたQを使用した場合、返される点は1台目のカメラの平行化座標系で表現される。
        Q - REF: stereoRectify で得られる \(4 \times 4\) の透視変換行列。
        handleMissingValues - 関数が欠損値(すなわち視差が計算されなかった点)を処理すべきかどうかを示す。handleMissingValues=true の場合、外れ値に対応する最小視差を持つピクセル(StereoMatcher::compute を参照)は、非常に大きなZ値(現在は10000に設定)を持つ3次元点に変換される。ビット深度。ddepthはCV_16S、CV_32S、CV_32Fに設定することもできる。この関数はシングルチャンネルの視差マップを、3次元曲面を表す3チャンネル画像に変換する。すなわち、各ピクセル(x,y)と対応する視差 d=disparity(x,y) に対して、次を計算する: \(\begin{bmatrix} X \\ Y \\ Z \\ W \end{bmatrix} = Q \begin{bmatrix} x \\ y \\ \texttt{disparity} (x,y) \\ 1 \end{bmatrix}.\) SEE: 疎な点集合 {(x,y,d),...} を3次元空間に再投影するには、perspectiveTransform を使用する。
      • reprojectImageTo3D

        public static void reprojectImageTo3D​(Mat disparity,
                                              Mat _3dImage,
                                              Mat Q)
        Reprojects a disparity image to 3D space.
        引数:
        disparity - 入力となるシングルチャンネルの8ビット符号なし、16ビット符号付き、32ビット符号付き、または32ビット浮動小数点の視差画像。8ビット/16ビット符号付き形式の値は小数部を持たないものとみなされる。視差がREF: StereoBM や REF: StereoSGBM、あるいは他のアルゴリズムで計算された16ビット符号付き形式の場合、ここで使用する前に16で割る必要がある(そしてfloatにスケーリングする)。
        _3dImage - disparityと同じサイズの3チャンネル浮動小数点出力画像。_3dImage(x,y)の各要素には、視差マップから計算された点(x,y)の3次元座標が格納される。REF: stereoRectify で得られたQを使用した場合、返される点は1台目のカメラの平行化座標系で表現される。
        Q - REF: stereoRectify で得られる \(4 \times 4\) の透視変換行列。視差が計算されなかった点)。handleMissingValues=true の場合、外れ値に対応する最小視差を持つピクセル(StereoMatcher::compute を参照)は、非常に大きなZ値(現在は10000に設定)を持つ3次元点に変換される。ビット深度。ddepthはCV_16S、CV_32S、CV_32Fに設定することもできる。この関数はシングルチャンネルの視差マップを、3次元曲面を表す3チャンネル画像に変換する。すなわち、各ピクセル(x,y)と対応する視差 d=disparity(x,y) に対して、次を計算する: \(\begin{bmatrix} X \\ Y \\ Z \\ W \end{bmatrix} = Q \begin{bmatrix} x \\ y \\ \texttt{disparity} (x,y) \\ 1 \end{bmatrix}.\) SEE: 疎な点集合 {(x,y,d),...} を3次元空間に再投影するには、perspectiveTransform を使用する。
      • sampsonDistance

        public static double sampsonDistance​(Mat pt1,
                                             Mat pt2,
                                             Mat F)
        Calculates the Sampson Distance between two points. The function cv::sampsonDistance calculates and returns the first order approximation of the geometric error as: \( sd( \texttt{pt1} , \texttt{pt2} )= \frac{(\texttt{pt2}^t \cdot \texttt{F} \cdot \texttt{pt1})^2} {((\texttt{F} \cdot \texttt{pt1})(0))^2 + ((\texttt{F} \cdot \texttt{pt1})(1))^2 + ((\texttt{F}^t \cdot \texttt{pt2})(0))^2 + ((\texttt{F}^t \cdot \texttt{pt2})(1))^2} \) The fundamental matrix may be calculated using the #findFundamentalMat function. See CITE: HartleyZ00 11.4.3 for details.
        引数:
        pt1 - 1つ目の同次2次元点
        pt2 - 2つ目の同次2次元点
        F - 基礎行列
        戻り値:
        計算されたサンプソン距離。
      • estimateAffine3D

        public static int estimateAffine3D​(Mat src,
                                           Mat dst,
                                           Mat out,
                                           Mat inliers,
                                           double ransacThreshold,
                                           double confidence)
        Computes an optimal affine transformation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)
        引数:
        src - \((X,Y,Z)\) を含む1つ目の入力3次元点集合。
        dst - \((x,y,z)\) を含む2つ目の入力3次元点集合。
        out - 次の形式をとる出力3次元アフィン変換行列 \(3 \times 4\)。 \( \begin{bmatrix} a_{11} & a_{12} & a_{13} & b_1\\ a_{21} & a_{22} & a_{23} & b_2\\ a_{31} & a_{32} & a_{33} & b_3\\ \end{bmatrix} \)
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        ransacThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。
        confidence - 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。この関数はRANSACアルゴリズムを用いて、2つの3次元点集合間の最適な3次元アフィン変換を推定する。
        戻り値:
        自動生成
      • estimateAffine3D

        public static int estimateAffine3D​(Mat src,
                                           Mat dst,
                                           Mat out,
                                           Mat inliers,
                                           double ransacThreshold)
        Computes an optimal affine transformation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)
        引数:
        src - \((X,Y,Z)\) を含む1つ目の入力3次元点集合。
        dst - \((x,y,z)\) を含む2つ目の入力3次元点集合。
        out - 次の形式をとる出力3次元アフィン変換行列 \(3 \times 4\)。 \( \begin{bmatrix} a_{11} & a_{12} & a_{13} & b_1\\ a_{21} & a_{22} & a_{23} & b_2\\ a_{31} & a_{32} & a_{33} & b_3\\ \end{bmatrix} \)
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        ransacThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。この関数はRANSACアルゴリズムを用いて、2つの3次元点集合間の最適な3次元アフィン変換を推定する。
        戻り値:
        自動生成
      • estimateAffine3D

        public static int estimateAffine3D​(Mat src,
                                           Mat dst,
                                           Mat out,
                                           Mat inliers)
        Computes an optimal affine transformation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)
        引数:
        src - \((X,Y,Z)\) を含む1つ目の入力3次元点集合。
        dst - \((x,y,z)\) を含む2つ目の入力3次元点集合。
        out - 次の形式をとる出力3次元アフィン変換行列 \(3 \times 4\)。 \( \begin{bmatrix} a_{11} & a_{12} & a_{13} & b_1\\ a_{21} & a_{22} & a_{23} & b_2\\ a_{31} & a_{32} & a_{33} & b_3\\ \end{bmatrix} \)
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。インライア。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。この関数はRANSACアルゴリズムを用いて、2つの3次元点集合間の最適な3次元アフィン変換を推定する。
        戻り値:
        自動生成
      • estimateAffine3D

        public static Mat estimateAffine3D​(Mat src,
                                           Mat dst,
                                           double[] scale,
                                           boolean force_rotation)
        Computes an optimal affine transformation between two 3D point sets. It computes \(R,s,t\) minimizing \(\sum{i} dst_i - c \cdot R \cdot src_i \) where \(R\) is a 3x3 rotation matrix, \(t\) is a 3x1 translation vector and \(s\) is a scalar size value. This is an implementation of the algorithm by Umeyama \cite umeyama1991least . The estimated affine transform has a homogeneous scale which is a subclass of affine transformations with 7 degrees of freedom. The paired point sets need to comprise at least 3 points each.
        引数:
        src - 1つ目の入力3次元点集合。
        dst - 2つ目の入力3次元点集合。
        scale - nullが渡された場合、スケール引数cは1.0とみなされる。それ以外の場合、指し示す変数に最適なスケールが設定される。
        force_rotation - trueの場合、返される回転は決して鏡映にならない。これは、例えば右手系と左手系の座標系間の変換を最適化する場合などには望ましくないことがある。
        戻り値:
        次の形式をとる3次元アフィン変換行列 \(3 \times 4\)。 \(T = \begin{bmatrix} R & t\\ \end{bmatrix} \)
      • estimateAffine3D

        public static Mat estimateAffine3D​(Mat src,
                                           Mat dst,
                                           double[] scale)
        Computes an optimal affine transformation between two 3D point sets. It computes \(R,s,t\) minimizing \(\sum{i} dst_i - c \cdot R \cdot src_i \) where \(R\) is a 3x3 rotation matrix, \(t\) is a 3x1 translation vector and \(s\) is a scalar size value. This is an implementation of the algorithm by Umeyama \cite umeyama1991least . The estimated affine transform has a homogeneous scale which is a subclass of affine transformations with 7 degrees of freedom. The paired point sets need to comprise at least 3 points each.
        引数:
        src - 1つ目の入力3次元点集合。
        dst - 2つ目の入力3次元点集合。
        scale - nullが渡された場合、スケール引数cは1.0とみなされる。それ以外の場合、指し示す変数に最適なスケールが設定される。これは、例えば右手系と左手系の座標系間の変換を最適化する場合などには望ましくないことがある。
        戻り値:
        次の形式をとる3次元アフィン変換行列 \(3 \times 4\)。 \(T = \begin{bmatrix} R & t\\ \end{bmatrix} \)
      • estimateAffine3D

        public static Mat estimateAffine3D​(Mat src,
                                           Mat dst)
        Computes an optimal affine transformation between two 3D point sets. It computes \(R,s,t\) minimizing \(\sum{i} dst_i - c \cdot R \cdot src_i \) where \(R\) is a 3x3 rotation matrix, \(t\) is a 3x1 translation vector and \(s\) is a scalar size value. This is an implementation of the algorithm by Umeyama \cite umeyama1991least . The estimated affine transform has a homogeneous scale which is a subclass of affine transformations with 7 degrees of freedom. The paired point sets need to comprise at least 3 points each.
        引数:
        src - 1つ目の入力3次元点集合。
        dst - 2つ目の入力3次元点集合。それ以外の場合、指し示す変数に最適なスケールが設定される。これは、例えば右手系と左手系の座標系間の変換を最適化する場合などには望ましくないことがある。
        戻り値:
        次の形式をとる3次元アフィン変換行列 \(3 \times 4\)。 \(T = \begin{bmatrix} R & t\\ \end{bmatrix} \)
      • estimateTranslation3D

        public static int estimateTranslation3D​(Mat src,
                                                Mat dst,
                                                Mat out,
                                                Mat inliers,
                                                double ransacThreshold,
                                                double confidence)
        Computes an optimal translation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)
        引数:
        src - \((X,Y,Z)\) を含む1つ目の入力3次元点集合。
        dst - \((x,y,z)\) を含む2つ目の入力3次元点集合。
        out - 次の形式をとる出力3次元並進ベクトル \(3 \times 1\)。 \( \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix} \)
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        ransacThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。
        confidence - 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。この関数はRANSACアルゴリズムを用いて、2つの3次元点集合間の最適な3次元並進を推定する。
        戻り値:
        自動生成
      • estimateTranslation3D

        public static int estimateTranslation3D​(Mat src,
                                                Mat dst,
                                                Mat out,
                                                Mat inliers,
                                                double ransacThreshold)
        Computes an optimal translation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)
        引数:
        src - \((X,Y,Z)\) を含む1つ目の入力3次元点集合。
        dst - \((x,y,z)\) を含む2つ目の入力3次元点集合。
        out - 次の形式をとる出力3次元並進ベクトル \(3 \times 1\)。 \( \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix} \)
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        ransacThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。この関数はRANSACアルゴリズムを用いて、2つの3次元点集合間の最適な3次元並進を推定する。
        戻り値:
        自動生成
      • estimateTranslation3D

        public static int estimateTranslation3D​(Mat src,
                                                Mat dst,
                                                Mat out,
                                                Mat inliers)
        Computes an optimal translation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)
        引数:
        src - \((X,Y,Z)\) を含む1つ目の入力3次元点集合。
        dst - \((x,y,z)\) を含む2つ目の入力3次元点集合。
        out - 次の形式をとる出力3次元並進ベクトル \(3 \times 1\)。 \( \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix} \)
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。インライア。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。この関数はRANSACアルゴリズムを用いて、2つの3次元点集合間の最適な3次元並進を推定する。
        戻り値:
        自動生成
      • estimateAffine2D

        public static Mat estimateAffine2D​(Mat from,
                                           Mat to,
                                           Mat inliers,
                                           int method,
                                           double ransacReprojThreshold,
                                           long maxIters,
                                           double confidence,
                                           long refineIters)
        Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。
        confidence - 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。
        refineIters - 改良アルゴリズム(Levenberg-Marquardt法)の最大反復回数。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。
        戻り値:
        出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
      • estimateAffine2D

        public static Mat estimateAffine2D​(Mat from,
                                           Mat to,
                                           Mat inliers,
                                           int method,
                                           double ransacReprojThreshold,
                                           long maxIters,
                                           double confidence)
        Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。
        confidence - 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。
        戻り値:
        出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
      • estimateAffine2D

        public static Mat estimateAffine2D​(Mat from,
                                           Mat to,
                                           Mat inliers,
                                           int method,
                                           double ransacReprojThreshold,
                                           long maxIters)
        Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。
        戻り値:
        出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
      • estimateAffine2D

        public static Mat estimateAffine2D​(Mat from,
                                           Mat to,
                                           Mat inliers,
                                           int method,
                                           double ransacReprojThreshold)
        Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。
        戻り値:
        出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
      • estimateAffine2D

        public static Mat estimateAffine2D​(Mat from,
                                           Mat to,
                                           Mat inliers,
                                           int method)
        Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. Passing 0 will disable refining, so the output matrix will be output of robust method.
        戻り値:
        出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
      • estimateAffine2D

        public static Mat estimateAffine2D​(Mat from,
                                           Mat to,
                                           Mat inliers)
        Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - Output vector indicating which points are inliers (1-inlier, 0-outlier).
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. Passing 0 will disable refining, so the output matrix will be output of robust method.
        戻り値:
        出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
      • estimateAffine2D

        public static Mat estimateAffine2D​(Mat from,
                                           Mat to)
        Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - Second input 2D point set containing \((x,y)\).
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. Passing 0 will disable refining, so the output matrix will be output of robust method.
        戻り値:
        出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
      • estimateAffine2D

        public static Mat estimateAffine2D​(Mat pts1,
                                           Mat pts2,
                                           Mat inliers,
                                           UsacParams params)
      • estimateAffinePartial2D

        public static Mat estimateAffinePartial2D​(Mat from,
                                                  Mat to,
                                                  Mat inliers,
                                                  int method,
                                                  double ransacReprojThreshold,
                                                  long maxIters,
                                                  double confidence,
                                                  long refineIters)
        Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
        引数:
        from - 1つ目の入力2次元点集合。
        to - 2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。
        confidence - 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。
        refineIters - 改良アルゴリズム(Levenberg-Marquardt法)の最大反復回数。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。
        戻り値:
        出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
      • estimateAffinePartial2D

        public static Mat estimateAffinePartial2D​(Mat from,
                                                  Mat to,
                                                  Mat inliers,
                                                  int method,
                                                  double ransacReprojThreshold,
                                                  long maxIters,
                                                  double confidence)
        Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
        引数:
        from - 1つ目の入力2次元点集合。
        to - 2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。
        confidence - 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。
        戻り値:
        出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
      • estimateAffinePartial2D

        public static Mat estimateAffinePartial2D​(Mat from,
                                                  Mat to,
                                                  Mat inliers,
                                                  int method,
                                                  double ransacReprojThreshold,
                                                  long maxIters)
        Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
        引数:
        from - 1つ目の入力2次元点集合。
        to - 2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。
        戻り値:
        出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
      • estimateAffinePartial2D

        public static Mat estimateAffinePartial2D​(Mat from,
                                                  Mat to,
                                                  Mat inliers,
                                                  int method,
                                                  double ransacReprojThreshold)
        Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
        引数:
        from - 1つ目の入力2次元点集合。
        to - 2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。
        戻り値:
        出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
      • estimateAffinePartial2D

        public static Mat estimateAffinePartial2D​(Mat from,
                                                  Mat to,
                                                  Mat inliers,
                                                  int method)
        Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
        引数:
        from - 1つ目の入力2次元点集合。
        to - 2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル。
        method - Robust method used to compute transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. Passing 0 will disable refining, so the output matrix will be output of robust method.
        戻り値:
        出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
      • estimateAffinePartial2D

        public static Mat estimateAffinePartial2D​(Mat from,
                                                  Mat to,
                                                  Mat inliers)
        Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
        引数:
        from - 1つ目の入力2次元点集合。
        to - 2つ目の入力2次元点集合。
        inliers - Output vector indicating which points are inliers.
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. Passing 0 will disable refining, so the output matrix will be output of robust method.
        戻り値:
        出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
      • estimateAffinePartial2D

        public static Mat estimateAffinePartial2D​(Mat from,
                                                  Mat to)
        Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
        引数:
        from - 1つ目の入力2次元点集合。
        to - Second input 2D point set.
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. Passing 0 will disable refining, so the output matrix will be output of robust method.
        戻り値:
        出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
      • estimateTranslation2D

        public static double[] estimateTranslation2D​(Mat from,
                                                     Mat to,
                                                     Mat inliers,
                                                     int method,
                                                     double ransacReprojThreshold,
                                                     long maxIters,
                                                     double confidence,
                                                     long refineIters)
        Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute the transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。
        confidence - 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。
        refineIters - 改良アルゴリズムの最大反復回数。純粋な並進の場合、インライア上の最小二乗解は閉形式で求まるため、0を渡すことが推奨される(追加の改良なし)。
        戻り値:
        cv::Vec2d としての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliers が指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \) cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]); この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
      • estimateTranslation2D

        public static double[] estimateTranslation2D​(Mat from,
                                                     Mat to,
                                                     Mat inliers,
                                                     int method,
                                                     double ransacReprojThreshold,
                                                     long maxIters,
                                                     double confidence)
        Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute the transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。
        confidence - 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。インライア上の最小二乗解は閉形式で求まるため、0を渡すことが推奨される(追加の改良なし)。
        戻り値:
        cv::Vec2d としての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliers が指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \) cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]); この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
      • estimateTranslation2D

        public static double[] estimateTranslation2D​(Mat from,
                                                     Mat to,
                                                     Mat inliers,
                                                     int method,
                                                     double ransacReprojThreshold,
                                                     long maxIters)
        Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute the transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。
        maxIters - ロバスト手法の最大反復回数。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。インライア上の最小二乗解は閉形式で求まるため、0を渡すことが推奨される(追加の改良なし)。
        戻り値:
        cv::Vec2d としての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliers が指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \) cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]); この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
      • estimateTranslation2D

        public static double[] estimateTranslation2D​(Mat from,
                                                     Mat to,
                                                     Mat inliers,
                                                     int method,
                                                     double ransacReprojThreshold)
        Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute the transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        ransacReprojThreshold - 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。インライア上の最小二乗解は閉形式で求まるため、0を渡すことが推奨される(追加の改良なし)。
        戻り値:
        cv::Vec2d としての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliers が指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \) cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]); この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
      • estimateTranslation2D

        public static double[] estimateTranslation2D​(Mat from,
                                                     Mat to,
                                                     Mat inliers,
                                                     int method)
        Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。
        method - Robust method used to compute the transformation. The following methods are possible:
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8–0.9 can result in an incorrectly estimated transformation. the least-squares solution on inliers is closed-form, so passing 0 is recommended (no additional refine).
        戻り値:
        cv::Vec2d としての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliers が指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \) cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]); この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
      • estimateTranslation2D

        public static double[] estimateTranslation2D​(Mat from,
                                                     Mat to,
                                                     Mat inliers)
        Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - \((x,y)\) を含む2つ目の入力2次元点集合。
        inliers - Output vector indicating which points are inliers (1-inlier, 0-outlier).
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8–0.9 can result in an incorrectly estimated transformation. the least-squares solution on inliers is closed-form, so passing 0 is recommended (no additional refine).
        戻り値:
        cv::Vec2d としての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliers が指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \) cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]); この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
      • estimateTranslation2D

        public static double[] estimateTranslation2D​(Mat from,
                                                     Mat to)
        Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)
        引数:
        from - \((X,Y)\) を含む1つ目の入力2次元点集合。
        to - Second input 2D point set containing \((x,y)\).
        • REF: RANSAC - RANSACベースのロバスト推定法
        • REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
        a point as an inlier. Applies only to RANSAC. between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. Values lower than 0.8–0.9 can result in an incorrectly estimated transformation. the least-squares solution on inliers is closed-form, so passing 0 is recommended (no additional refine).
        戻り値:
        cv::Vec2d としての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliers が指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \) cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]); この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
      • decomposeHomographyMat

        public static int decomposeHomographyMat​(Mat H,
                                                 Mat K,
                                                 java.util.List<Mat> rotations,
                                                 java.util.List<Mat> translations,
                                                 java.util.List<Mat> normals)
        Decompose a homography matrix to rotation(s), translation(s) and plane normal(s).
        引数:
        H - 2枚の画像間の入力ホモグラフィ行列。
        K - 入力カメラ内部パラメータ行列。
        rotations - 回転行列の配列。
        translations - 並進行列の配列。
        normals - 平面法線行列の配列。この関数は、平面物体の2つの視点間の相対的なカメラ運動を抽出し、回転・並進・平面法線の数学的な解の組を最大4つ返す。ホモグラフィ行列Hの分解については、CITE: Malis2007 に詳しく記述されている。平面によって誘導されるホモグラフィHが、ソース画像上の点 \(p_i\) とデスティネーション画像上の点 \(p'_i\) について制約 \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) を与える場合、rotations[k] と translations[k] の組は、ソースカメラの座標系からデスティネーションカメラの座標系への基底変換となる。ただし、Hを分解することによって得られるのは、(一般に未知の)シーンの奥行きで正規化された並進、すなわちその方向だけであり、長さは正規化されている。点対応が利用可能であれば、正の奥行き制約を適用することにより、すなわちすべての点がカメラの前方になければならないという条件により、少なくとも2つの解をさらに無効化できる。
        戻り値:
        自動生成
      • filterHomographyDecompByVisibleRefpoints

        public static void filterHomographyDecompByVisibleRefpoints​(java.util.List<Mat> rotations,
                                                                    java.util.List<Mat> normals,
                                                                    Mat beforePoints,
                                                                    Mat afterPoints,
                                                                    Mat possibleSolutions,
                                                                    Mat pointsMask)
        Filters homography decompositions based on additional information.
        引数:
        rotations - 回転行列のベクトル。
        normals - 平面法線行列のベクトル。
        beforePoints - ホモグラフィ適用前の(平行化済みの)可視な参照点のベクトル
        afterPoints - ホモグラフィ適用後の(平行化済みの)可視な参照点のベクトル
        possibleSolutions - フィルタリング後の実行可能な解集合を表すintインデックスのベクトル
        pointsMask - #findHomography 関数によって与えられるインライアのマスクを表す、省略可能な8u型のMat/ベクトル。この関数は、CITE: Malis2007 に記述された追加情報に基づいて #decomposeHomographyMat の出力をフィルタリングすることを目的としている。手法の概要: #decomposeHomographyMat 関数は2つの一意な解とそれらの「反対解」を返し、合計4つの解となる。ホモグラフィ変換が適用される前後にカメラフレーム内で可視であった点の集合にアクセスできれば、すべての可視な参照点がカメラの前方にあることと整合するホモグラフィを検証することにより、どれが真の潜在的な解で、どれが反対解であるかを判定できる。入力は変更されず、フィルタリングされた解集合は既存の集合へのインデックスとして返される。
      • filterHomographyDecompByVisibleRefpoints

        public static void filterHomographyDecompByVisibleRefpoints​(java.util.List<Mat> rotations,
                                                                    java.util.List<Mat> normals,
                                                                    Mat beforePoints,
                                                                    Mat afterPoints,
                                                                    Mat possibleSolutions)
        Filters homography decompositions based on additional information.
        引数:
        rotations - 回転行列のベクトル。
        normals - 平面法線行列のベクトル。
        beforePoints - ホモグラフィ適用前の(平行化済みの)可視な参照点のベクトル
        afterPoints - ホモグラフィ適用後の(平行化済みの)可視な参照点のベクトル
        possibleSolutions - フィルタリング後の実行可能な解集合を表すintインデックスのベクトル。この関数は、CITE: Malis2007 に記述された追加情報に基づいて #decomposeHomographyMat の出力をフィルタリングすることを目的としている。手法の概要: #decomposeHomographyMat 関数は2つの一意な解とそれらの「反対解」を返し、合計4つの解となる。ホモグラフィ変換が適用される前後にカメラフレーム内で可視であった点の集合にアクセスできれば、すべての可視な参照点がカメラの前方にあることと整合するホモグラフィを検証することにより、どれが真の潜在的な解で、どれが反対解であるかを判定できる。入力は変更されず、フィルタリングされた解集合は既存の集合へのインデックスとして返される。
      • undistort

        public static void undistort​(Mat src,
                                     Mat dst,
                                     Mat cameraMatrix,
                                     Mat distCoeffs,
                                     Mat newCameraMatrix)
        Transforms an image to compensate for lens distortion. The function transforms an image to compensate radial and tangential lens distortion. The function is simply a combination of #initUndistortRectifyMap (with unity R ) and #remap (with bilinear interpolation). See the former function for details of the transformation being performed. Those pixels in the destination image, for which there is no correspondent pixels in the source image, are filled with zeros (black color). A particular subset of the source image that will be visible in the corrected image can be regulated by newCameraMatrix. You can use #getOptimalNewCameraMatrix to compute the appropriate newCameraMatrix depending on your requirements. The camera matrix and the distortion parameters can be determined using #calibrateCamera. If the resolution of images is different from the resolution used at the calibration stage, \(f_x, f_y, c_x\) and \(c_y\) need to be scaled accordingly, while the distortion coefficients remain the same.
        引数:
        src - 入力(歪んだ)画像。
        dst - src と同じサイズ・型を持つ出力(補正後)画像。
        cameraMatrix - 入力カメラ行列 \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。
        newCameraMatrix - 歪んだ画像のカメラ行列。デフォルトでは cameraMatrix と同じだが、別の行列を用いることで結果をスケーリング・シフトすることもできる。
      • undistort

        public static void undistort​(Mat src,
                                     Mat dst,
                                     Mat cameraMatrix,
                                     Mat distCoeffs)
        Transforms an image to compensate for lens distortion. The function transforms an image to compensate radial and tangential lens distortion. The function is simply a combination of #initUndistortRectifyMap (with unity R ) and #remap (with bilinear interpolation). See the former function for details of the transformation being performed. Those pixels in the destination image, for which there is no correspondent pixels in the source image, are filled with zeros (black color). A particular subset of the source image that will be visible in the corrected image can be regulated by newCameraMatrix. You can use #getOptimalNewCameraMatrix to compute the appropriate newCameraMatrix depending on your requirements. The camera matrix and the distortion parameters can be determined using #calibrateCamera. If the resolution of images is different from the resolution used at the calibration stage, \(f_x, f_y, c_x\) and \(c_y\) need to be scaled accordingly, while the distortion coefficients remain the same.
        引数:
        src - 入力(歪んだ)画像。
        dst - src と同じサイズ・型を持つ出力(補正後)画像。
        cameraMatrix - 入力カメラ行列 \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。cameraMatrix だが、別の行列を用いることで結果をスケーリング・シフトすることもできる。
      • initUndistortRectifyMap

        public static void initUndistortRectifyMap​(Mat cameraMatrix,
                                                   Mat distCoeffs,
                                                   Mat R,
                                                   Mat newCameraMatrix,
                                                   Size size,
                                                   int m1type,
                                                   Mat map1,
                                                   Mat map2)
        Computes the undistortion and rectification transformation map. The function computes the joint undistortion and rectification transformation and represents the result in the form of maps for #remap. The undistorted image looks like original, as if it is captured with a camera using the camera matrix =newCameraMatrix and zero distortion. In case of a monocular camera, newCameraMatrix is usually equal to cameraMatrix, or it can be computed by #getOptimalNewCameraMatrix for a better control over scaling. In case of a stereo camera, newCameraMatrix is normally set to P1 or P2 computed by #stereoRectify . Also, this new camera is oriented differently in the coordinate space, according to R. That, for example, helps to align two heads of a stereo camera so that the epipolar lines on both images become horizontal and have the same y- coordinate (in case of a horizontally aligned stereo camera). The function actually builds the maps for the inverse mapping algorithm that is used by #remap. That is, for each pixel \((u, v)\) in the destination (corrected and rectified) image, the function computes the corresponding coordinates in the source image (that is, in the original image from camera). The following process is applied: \( \begin{array}{l} x \leftarrow (u - {c'}_x)/{f'}_x \\ y \leftarrow (v - {c'}_y)/{f'}_y \\ {[X\,Y\,W]} ^T \leftarrow R^{-1}*[x \, y \, 1]^T \\ x' \leftarrow X/W \\ y' \leftarrow Y/W \\ r^2 \leftarrow x'^2 + y'^2 \\ x'' \leftarrow x' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + 2p_1 x' y' + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4\\ y'' \leftarrow y' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\ s\vecthree{x'''}{y'''}{1} = \vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}((\tau_x, \tau_y)} {0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)} {0}{0}{1} R(\tau_x, \tau_y) \vecthree{x''}{y''}{1}\\ map_x(u,v) \leftarrow x''' f_x + c_x \\ map_y(u,v) \leftarrow y''' f_y + c_y \end{array} \) where \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) are the distortion coefficients. In case of a stereo camera, this function is called twice: once for each camera head, after #stereoRectify, which in its turn is called after #stereoCalibrate. But if the stereo camera was not calibrated, it is still possible to compute the rectification transformations directly from the fundamental matrix using #stereoRectifyUncalibrated. For each camera, the function computes homography H as the rectification transformation in a pixel domain, not a rotation matrix R in 3D space. R can be computed from H as \(\texttt{R} = \texttt{cameraMatrix} ^{-1} \cdot \texttt{H} \cdot \texttt{cameraMatrix}\) where cameraMatrix can be chosen arbitrarily.
        引数:
        cameraMatrix - 入力カメラ行列 \(A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。
        R - オブジェクト空間における省略可能な平行化変換(3x3行列)。#stereoRectify で計算された R1 または R2 をここに渡すことができる。行列が空の場合は、恒等変換を仮定する。#initUndistortRectifyMap では R は恒等行列と仮定される。
        newCameraMatrix - 新しいカメラ行列 \(A'=\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}\)。
        size - 歪み補正後の画像サイズ。
        m1type - 1つ目の出力マップの型。CV_32FC1、CV_32FC2 または CV_16SC2 が指定できる。#convertMaps を参照。
        map1 - 1つ目の出力マップ。
        map2 - 2つ目の出力マップ。
      • initInverseRectificationMap

        public static void initInverseRectificationMap​(Mat cameraMatrix,
                                                       Mat distCoeffs,
                                                       Mat R,
                                                       Mat newCameraMatrix,
                                                       Size size,
                                                       int m1type,
                                                       Mat map1,
                                                       Mat map2)
        Computes the projection and inverse-rectification transformation map. In essense, this is the inverse of #initUndistortRectifyMap to accomodate stereo-rectification of projectors ('inverse-cameras') in projector-camera pairs. The function computes the joint projection and inverse rectification transformation and represents the result in the form of maps for #remap. The projected image looks like a distorted version of the original which, once projected by a projector, should visually match the original. In case of a monocular camera, newCameraMatrix is usually equal to cameraMatrix, or it can be computed by #getOptimalNewCameraMatrix for a better control over scaling. In case of a projector-camera pair, newCameraMatrix is normally set to P1 or P2 computed by #stereoRectify . The projector is oriented differently in the coordinate space, according to R. In case of projector-camera pairs, this helps align the projector (in the same manner as #initUndistortRectifyMap for the camera) to create a stereo-rectified pair. This allows epipolar lines on both images to become horizontal and have the same y-coordinate (in case of a horizontally aligned projector-camera pair). The function builds the maps for the inverse mapping algorithm that is used by #remap. That is, for each pixel \((u, v)\) in the destination (projected and inverse-rectified) image, the function computes the corresponding coordinates in the source image (that is, in the original digital image). The following process is applied: \( \begin{array}{l} \text{newCameraMatrix}\\ x \leftarrow (u - {c'}_x)/{f'}_x \\ y \leftarrow (v - {c'}_y)/{f'}_y \\ \\\text{Undistortion} \\\scriptsize{\textit{though equation shown is for radial undistortion, function implements cv::undistortPoints()}}\\ r^2 \leftarrow x^2 + y^2 \\ \theta \leftarrow \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}\\ x' \leftarrow \frac{x}{\theta} \\ y' \leftarrow \frac{y}{\theta} \\ \\\text{Rectification}\\ {[X\,Y\,W]} ^T \leftarrow R*[x' \, y' \, 1]^T \\ x'' \leftarrow X/W \\ y'' \leftarrow Y/W \\ \\\text{cameraMatrix}\\ map_x(u,v) \leftarrow x'' f_x + c_x \\ map_y(u,v) \leftarrow y'' f_y + c_y \end{array} \) where \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) are the distortion coefficients vector distCoeffs. In case of a stereo-rectified projector-camera pair, this function is called for the projector while #initUndistortRectifyMap is called for the camera head. This is done after #stereoRectify, which in turn is called after #stereoCalibrate. If the projector-camera pair is not calibrated, it is still possible to compute the rectification transformations directly from the fundamental matrix using #stereoRectifyUncalibrated. For the projector and camera, the function computes homography H as the rectification transformation in a pixel domain, not a rotation matrix R in 3D space. R can be computed from H as \(\texttt{R} = \texttt{cameraMatrix} ^{-1} \cdot \texttt{H} \cdot \texttt{cameraMatrix}\) where cameraMatrix can be chosen arbitrarily.
        引数:
        cameraMatrix - 入力カメラ行列 \(A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。
        R - オブジェクト空間における省略可能な平行化変換(3x3行列)。#stereoRectify で計算された R1 または R2 をここに渡すことができる。行列が空の場合は、恒等変換を仮定する。
        newCameraMatrix - 新しいカメラ行列 \(A'=\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}\)。
        size - 歪んだ画像のサイズ。
        m1type - 1つ目の出力マップの型。CV_32FC1、CV_32FC2 または CV_16SC2 が指定できる。#convertMaps を参照。
        map1 - #remap 用の1つ目の出力マップ。
        map2 - #remap 用の2つ目の出力マップ。
      • getDefaultNewCameraMatrix

        public static Mat getDefaultNewCameraMatrix​(Mat cameraMatrix,
                                                    Size imgsize,
                                                    boolean centerPrincipalPoint)
        Returns the default new camera matrix. The function returns the camera matrix that is either an exact copy of the input cameraMatrix (when centerPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true). In the latter case, the new camera matrix will be: \(\begin{bmatrix} f_x && 0 && ( \texttt{imgSize.width} -1)*0.5 \\ 0 && f_y && ( \texttt{imgSize.height} -1)*0.5 \\ 0 && 0 && 1 \end{bmatrix} ,\) where \(f_x\) and \(f_y\) are \((0,0)\) and \((1,1)\) elements of cameraMatrix, respectively. By default, the undistortion functions in OpenCV (see #initUndistortRectifyMap, #undistort) do not move the principal point. However, when you work with stereo, it is important to move the principal points in both views to the same y-coordinate (which is required by most of stereo correspondence algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for each view where the principal points are located at the center.
        引数:
        cameraMatrix - 入力カメラ行列。
        imgsize - カメラ視野画像のサイズ(ピクセル単位)。
        centerPrincipalPoint - 新しいカメラ行列における主点の位置。この引数は、この位置を画像中心にするかどうかを示す。
        戻り値:
        自動生成
      • getDefaultNewCameraMatrix

        public static Mat getDefaultNewCameraMatrix​(Mat cameraMatrix,
                                                    Size imgsize)
        Returns the default new camera matrix. The function returns the camera matrix that is either an exact copy of the input cameraMatrix (when centerPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true). In the latter case, the new camera matrix will be: \(\begin{bmatrix} f_x && 0 && ( \texttt{imgSize.width} -1)*0.5 \\ 0 && f_y && ( \texttt{imgSize.height} -1)*0.5 \\ 0 && 0 && 1 \end{bmatrix} ,\) where \(f_x\) and \(f_y\) are \((0,0)\) and \((1,1)\) elements of cameraMatrix, respectively. By default, the undistortion functions in OpenCV (see #initUndistortRectifyMap, #undistort) do not move the principal point. However, when you work with stereo, it is important to move the principal points in both views to the same y-coordinate (which is required by most of stereo correspondence algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for each view where the principal points are located at the center.
        引数:
        cameraMatrix - 入力カメラ行列。
        imgsize - カメラ視野画像のサイズ(ピクセル単位)。この引数は、この位置を画像中心にするかどうかを示す。
        戻り値:
        自動生成
      • getDefaultNewCameraMatrix

        public static Mat getDefaultNewCameraMatrix​(Mat cameraMatrix)
        Returns the default new camera matrix. The function returns the camera matrix that is either an exact copy of the input cameraMatrix (when centerPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true). In the latter case, the new camera matrix will be: \(\begin{bmatrix} f_x && 0 && ( \texttt{imgSize.width} -1)*0.5 \\ 0 && f_y && ( \texttt{imgSize.height} -1)*0.5 \\ 0 && 0 && 1 \end{bmatrix} ,\) where \(f_x\) and \(f_y\) are \((0,0)\) and \((1,1)\) elements of cameraMatrix, respectively. By default, the undistortion functions in OpenCV (see #initUndistortRectifyMap, #undistort) do not move the principal point. However, when you work with stereo, it is important to move the principal points in both views to the same y-coordinate (which is required by most of stereo correspondence algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for each view where the principal points are located at the center.
        引数:
        cameraMatrix - 入力カメラ行列。この引数は、この位置を画像中心にするかどうかを示す。
        戻り値:
        自動生成
      • undistortPoints

        public static void undistortPoints​(MatOfPoint2f src,
                                           MatOfPoint2f dst,
                                           Mat cameraMatrix,
                                           Mat distCoeffs,
                                           Mat R,
                                           Mat P)
        Computes the ideal point coordinates from the observed point coordinates. The function is similar to #undistort and #initUndistortRectifyMap but it operates on a sparse set of points instead of a raster image. Also the function performs a reverse transformation to #projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a planar object, it does, up to a translation vector, if the proper R is specified. For each observed point coordinate \((u, v)\) the function computes: \( \begin{array}{l} x^{"} \leftarrow (u - c_x)/f_x \\ y^{"} \leftarrow (v - c_y)/f_y \\ (x',y') = undistort(x^{"},y^{"}, \texttt{distCoeffs}) \\ {[X\,Y\,W]} ^T \leftarrow R*[x' \, y' \, 1]^T \\ x \leftarrow X/W \\ y \leftarrow Y/W \\ \text{only performed if P is specified:} \\ u' \leftarrow x {f'}_x + {c'}_x \\ v' \leftarrow y {f'}_y + {c'}_y \end{array} \) where *undistort* is an approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates ("normalized" means that the coordinates do not depend on the camera matrix). The function can be used for both a stereo camera head or a monocular camera (when R is empty).
        引数:
        src - 観測された点の座標。2xN/Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。
        dst - 歪み補正および逆透視変換後の理想的な点の出力座標(1xN/Nx1 の2チャンネル、または vector<Point2f> )。行列 P が恒等行列または省略された場合、dst には正規化された点の座標が格納される。
        cameraMatrix - カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。
        R - オブジェクト空間における平行化変換(3x3行列)。#stereoRectify で計算された R1 または R2 をここに渡すことができる。行列が空の場合は、恒等変換が用いられる。
        P - 新しいカメラ行列(3x3)または新しい射影行列(3x4) \(\begin{bmatrix} {f'}_x & 0 & {c'}_x & t_x \\ 0 & {f'}_y & {c'}_y & t_y \\ 0 & 0 & 1 & t_z \end{bmatrix}\)。#stereoRectify で計算された P1 または P2 をここに渡すことができる。行列が空の場合は、恒等な新しいカメラ行列が用いられる。
      • undistortPoints

        public static void undistortPoints​(MatOfPoint2f src,
                                           MatOfPoint2f dst,
                                           Mat cameraMatrix,
                                           Mat distCoeffs,
                                           Mat R)
        Computes the ideal point coordinates from the observed point coordinates. The function is similar to #undistort and #initUndistortRectifyMap but it operates on a sparse set of points instead of a raster image. Also the function performs a reverse transformation to #projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a planar object, it does, up to a translation vector, if the proper R is specified. For each observed point coordinate \((u, v)\) the function computes: \( \begin{array}{l} x^{"} \leftarrow (u - c_x)/f_x \\ y^{"} \leftarrow (v - c_y)/f_y \\ (x',y') = undistort(x^{"},y^{"}, \texttt{distCoeffs}) \\ {[X\,Y\,W]} ^T \leftarrow R*[x' \, y' \, 1]^T \\ x \leftarrow X/W \\ y \leftarrow Y/W \\ \text{only performed if P is specified:} \\ u' \leftarrow x {f'}_x + {c'}_x \\ v' \leftarrow y {f'}_y + {c'}_y \end{array} \) where *undistort* is an approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates ("normalized" means that the coordinates do not depend on the camera matrix). The function can be used for both a stereo camera head or a monocular camera (when R is empty).
        引数:
        src - 観測された点の座標。2xN/Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。
        dst - 歪み補正および逆透視変換後の理想的な点の出力座標(1xN/Nx1 の2チャンネル、または vector<Point2f> )。行列 P が恒等行列または省略された場合、dst には正規化された点の座標が格納される。
        cameraMatrix - カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。
        R - オブジェクト空間における平行化変換(3x3行列)。#stereoRectify で計算された R1 または R2 をここに渡すことができる。行列が空の場合は、恒等変換が用いられる。#stereoRectify でここに渡すことができる。行列が空の場合は、恒等な新しいカメラ行列が用いられる。
      • undistortPoints

        public static void undistortPoints​(MatOfPoint2f src,
                                           MatOfPoint2f dst,
                                           Mat cameraMatrix,
                                           Mat distCoeffs)
        Computes the ideal point coordinates from the observed point coordinates. The function is similar to #undistort and #initUndistortRectifyMap but it operates on a sparse set of points instead of a raster image. Also the function performs a reverse transformation to #projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a planar object, it does, up to a translation vector, if the proper R is specified. For each observed point coordinate \((u, v)\) the function computes: \( \begin{array}{l} x^{"} \leftarrow (u - c_x)/f_x \\ y^{"} \leftarrow (v - c_y)/f_y \\ (x',y') = undistort(x^{"},y^{"}, \texttt{distCoeffs}) \\ {[X\,Y\,W]} ^T \leftarrow R*[x' \, y' \, 1]^T \\ x \leftarrow X/W \\ y \leftarrow Y/W \\ \text{only performed if P is specified:} \\ u' \leftarrow x {f'}_x + {c'}_x \\ v' \leftarrow y {f'}_y + {c'}_y \end{array} \) where *undistort* is an approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates ("normalized" means that the coordinates do not depend on the camera matrix). The function can be used for both a stereo camera head or a monocular camera (when R is empty).
        引数:
        src - 観測された点の座標。2xN/Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。
        dst - 歪み補正および逆透視変換後の理想的な点の出力座標(1xN/Nx1 の2チャンネル、または vector<Point2f> )。行列 P が恒等行列または省略された場合、dst には正規化された点の座標が格納される。
        cameraMatrix - カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。#stereoRectify でここに渡すことができる。行列が空の場合は、恒等変換が用いられる。#stereoRectify でここに渡すことができる。行列が空の場合は、恒等な新しいカメラ行列が用いられる。
      • undistortPointsIter

        public static void undistortPointsIter​(Mat src,
                                               Mat dst,
                                               Mat cameraMatrix,
                                               Mat distCoeffs,
                                               Mat R,
                                               Mat P,
                                               TermCriteria criteria)
        覚え書き: Default version of #undistortPoints does 5 iterations to compute undistorted points.
        引数:
        src - 自動生成
        dst - 自動生成
        cameraMatrix - 自動生成
        distCoeffs - 自動生成
        R - 自動生成
        P - 自動生成
        criteria - 自動生成
      • undistortImagePoints

        public static void undistortImagePoints​(Mat src,
                                                Mat dst,
                                                Mat cameraMatrix,
                                                Mat distCoeffs,
                                                TermCriteria arg1)
        Compute undistorted image points position
        引数:
        src - 観測された点の位置。2xN/Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。
        dst - 歪み補正後の点の出力位置(1xN/Nx1 の2チャンネル、または vector<Point2f> )。
        cameraMatrix - カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 歪み係数
        arg1 - 自動生成
      • undistortImagePoints

        public static void undistortImagePoints​(Mat src,
                                                Mat dst,
                                                Mat cameraMatrix,
                                                Mat distCoeffs)
        Compute undistorted image points position
        引数:
        src - 観測された点の位置。2xN/Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。
        dst - 歪み補正後の点の出力位置(1xN/Nx1 の2チャンネル、または vector<Point2f> )。
        cameraMatrix - カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。
        distCoeffs - 歪み係数
      • fisheye_projectPoints

        public static void fisheye_projectPoints​(Mat objectPoints,
                                                 Mat imagePoints,
                                                 Mat rvec,
                                                 Mat tvec,
                                                 Mat K,
                                                 Mat D,
                                                 double alpha,
                                                 Mat jacobian)
      • fisheye_projectPoints

        public static void fisheye_projectPoints​(Mat objectPoints,
                                                 Mat imagePoints,
                                                 Mat rvec,
                                                 Mat tvec,
                                                 Mat K,
                                                 Mat D,
                                                 double alpha)
      • fisheye_projectPoints

        public static void fisheye_projectPoints​(Mat objectPoints,
                                                 Mat imagePoints,
                                                 Mat rvec,
                                                 Mat tvec,
                                                 Mat K,
                                                 Mat D)
      • fisheye_distortPoints

        public static void fisheye_distortPoints​(Mat undistorted,
                                                 Mat distorted,
                                                 Mat K,
                                                 Mat D,
                                                 double alpha)
        Distorts 2D points using fisheye model.
        引数:
        undistorted - オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        alpha - スキュー係数。
        distorted - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。なお、この関数は歪み補正後の点のカメラ内部行列を恒等行列と仮定する。つまり、画像点に歪みを加えたい場合は、それらに \(K^{-1}\) を掛けるか、別のオーバーロード関数を使用する必要がある。
      • fisheye_distortPoints

        public static void fisheye_distortPoints​(Mat undistorted,
                                                 Mat distorted,
                                                 Mat K,
                                                 Mat D)
        Distorts 2D points using fisheye model.
        引数:
        undistorted - オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        distorted - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。なお、この関数は歪み補正後の点のカメラ内部行列を恒等行列と仮定する。つまり、画像点に歪みを加えたい場合は、それらに \(K^{-1}\) を掛けるか、別のオーバーロード関数を使用する必要がある。
      • fisheye_distortPoints

        public static void fisheye_distortPoints​(Mat undistorted,
                                                 Mat distorted,
                                                 Mat Kundistorted,
                                                 Mat K,
                                                 Mat D,
                                                 double alpha)
        Overload of distortPoints function to handle cases when undistorted points are obtained with non-identity camera matrix, e.g. output of #estimateNewCameraMatrixForUndistortRectify.
        引数:
        undistorted - オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。
        Kundistorted - 歪み補正の新しいカメラ行列として用いられるカメラ内部行列。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        alpha - スキュー係数。
        distorted - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。SEE: estimateNewCameraMatrixForUndistortRectify
      • fisheye_distortPoints

        public static void fisheye_distortPoints​(Mat undistorted,
                                                 Mat distorted,
                                                 Mat Kundistorted,
                                                 Mat K,
                                                 Mat D)
        Overload of distortPoints function to handle cases when undistorted points are obtained with non-identity camera matrix, e.g. output of #estimateNewCameraMatrixForUndistortRectify.
        引数:
        undistorted - オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。
        Kundistorted - 歪み補正の新しいカメラ行列として用いられるカメラ内部行列。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        distorted - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。SEE: estimateNewCameraMatrixForUndistortRectify
      • fisheye_undistortPoints

        public static void fisheye_undistortPoints​(Mat distorted,
                                                   Mat undistorted,
                                                   Mat K,
                                                   Mat D,
                                                   Mat R,
                                                   Mat P,
                                                   TermCriteria criteria)
        Undistorts 2D points using fisheye model
        引数:
        distorted - オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        R - オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネル
        P - 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)
        criteria - 終了条件
        undistorted - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。
      • fisheye_undistortPoints

        public static void fisheye_undistortPoints​(Mat distorted,
                                                   Mat undistorted,
                                                   Mat K,
                                                   Mat D,
                                                   Mat R,
                                                   Mat P)
        Undistorts 2D points using fisheye model
        引数:
        distorted - オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        R - オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネル
        P - 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)
        undistorted - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。
      • fisheye_undistortPoints

        public static void fisheye_undistortPoints​(Mat distorted,
                                                   Mat undistorted,
                                                   Mat K,
                                                   Mat D,
                                                   Mat R)
        Undistorts 2D points using fisheye model
        引数:
        distorted - オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        R - オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネル
        undistorted - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。
      • fisheye_undistortPoints

        public static void fisheye_undistortPoints​(Mat distorted,
                                                   Mat undistorted,
                                                   Mat K,
                                                   Mat D)
        Undistorts 2D points using fisheye model
        引数:
        distorted - オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。シングルチャンネルまたは 1x1 の3チャンネル
        undistorted - 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。
      • fisheye_initUndistortRectifyMap

        public static void fisheye_initUndistortRectifyMap​(Mat K,
                                                           Mat D,
                                                           Mat R,
                                                           Mat P,
                                                           Size size,
                                                           int m1type,
                                                           Mat map1,
                                                           Mat map2)
        Computes undistortion and rectification maps for image transform by #remap. If D is empty zero distortion is used, if R or P is empty identity matrixes are used.
        引数:
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        R - オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネル
        P - 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)
        size - 歪み補正後の画像サイズ。
        m1type - 1つ目の出力マップの型。CV_32FC1 または CV_16SC2 が指定できる。詳細は #convertMaps を参照。
        map1 - 1つ目の出力マップ。
        map2 - 2つ目の出力マップ。
      • fisheye_undistortImage

        public static void fisheye_undistortImage​(Mat distorted,
                                                  Mat undistorted,
                                                  Mat K,
                                                  Mat D,
                                                  Mat Knew,
                                                  Size new_size)
        Transforms an image to compensate for fisheye lens distortion.
        引数:
        distorted - 魚眼レンズの歪みを含む画像。
        undistorted - 魚眼レンズの歪みを補正した出力画像。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        Knew - 歪んだ画像のカメラ内部行列。デフォルトでは恒等行列だが、別の行列を用いることで結果をスケーリング・シフトすることもできる。
        new_size - the new size The function transforms an image to compensate radial lens distortion. The function is simply a combination of #fisheye::initUndistortRectifyMap (with unity R ) and #remap (with bilinear interpolation). See the former function for details of the transformation being performed. See below the results of undistortImage.
        • a\) result of undistort of perspective camera model (all possible coefficients (k_1, k_2, k_3, k_4, k_5, k_6) of distortion were optimized under calibration)
          • b\) 魚眼カメラモデルの #fisheye::undistortImage の結果(魚眼歪みのすべての係数 (k_1, k_2, k_3, k_4) がキャリブレーションで最適化された)
          • c\) 元画像は魚眼レンズで撮影された
          Pictures a) and b) almost the same. But if we consider points of image located far from the center of image, we can notice that on image a) these points are distorted.
        ![image](pics/fisheye_undistorted.jpg)
      • fisheye_undistortImage

        public static void fisheye_undistortImage​(Mat distorted,
                                                  Mat undistorted,
                                                  Mat K,
                                                  Mat D,
                                                  Mat Knew)
        Transforms an image to compensate for fisheye lens distortion.
        引数:
        distorted - 魚眼レンズの歪みを含む画像。
        undistorted - 魚眼レンズの歪みを補正した出力画像。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        Knew - Camera intrinsic matrix of the distorted image. By default, it is the identity matrix but you may additionally scale and shift the result by using a different matrix. The function transforms an image to compensate radial lens distortion. The function is simply a combination of #fisheye::initUndistortRectifyMap (with unity R ) and #remap (with bilinear interpolation). See the former function for details of the transformation being performed. See below the results of undistortImage.
        • a\) result of undistort of perspective camera model (all possible coefficients (k_1, k_2, k_3, k_4, k_5, k_6) of distortion were optimized under calibration)
          • b\) 魚眼カメラモデルの #fisheye::undistortImage の結果(魚眼歪みのすべての係数 (k_1, k_2, k_3, k_4) がキャリブレーションで最適化された)
          • c\) 元画像は魚眼レンズで撮影された
          Pictures a) and b) almost the same. But if we consider points of image located far from the center of image, we can notice that on image a) these points are distorted.
        ![image](pics/fisheye_undistorted.jpg)
      • fisheye_undistortImage

        public static void fisheye_undistortImage​(Mat distorted,
                                                  Mat undistorted,
                                                  Mat K,
                                                  Mat D)
        Transforms an image to compensate for fisheye lens distortion.
        引数:
        distorted - 魚眼レンズの歪みを含む画像。
        undistorted - 魚眼レンズの歪みを補正した出力画像。
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        D - Input vector of distortion coefficients \(\distcoeffsfisheye\). may additionally scale and shift the result by using a different matrix. The function transforms an image to compensate radial lens distortion. The function is simply a combination of #fisheye::initUndistortRectifyMap (with unity R ) and #remap (with bilinear interpolation). See the former function for details of the transformation being performed. See below the results of undistortImage.
        • a\) result of undistort of perspective camera model (all possible coefficients (k_1, k_2, k_3, k_4, k_5, k_6) of distortion were optimized under calibration)
          • b\) 魚眼カメラモデルの #fisheye::undistortImage の結果(魚眼歪みのすべての係数 (k_1, k_2, k_3, k_4) がキャリブレーションで最適化された)
          • c\) 元画像は魚眼レンズで撮影された
          Pictures a) and b) almost the same. But if we consider points of image located far from the center of image, we can notice that on image a) these points are distorted.
        ![image](pics/fisheye_undistorted.jpg)
      • fisheye_estimateNewCameraMatrixForUndistortRectify

        public static void fisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K,
                                                                              Mat D,
                                                                              Size image_size,
                                                                              Mat R,
                                                                              Mat P,
                                                                              double balance,
                                                                              Size new_size,
                                                                              double fov_scale)
        Estimates new camera intrinsic matrix for undistortion or rectification.
        引数:
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        image_size - 画像のサイズ
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        R - オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネル
        P - 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)
        balance - 最小焦点距離と最大焦点距離の間の範囲で新しい焦点距離を設定する。balance は [0, 1] の範囲。
        new_size - 新しいサイズ
        fov_scale - 新しい焦点距離の除数。
      • fisheye_estimateNewCameraMatrixForUndistortRectify

        public static void fisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K,
                                                                              Mat D,
                                                                              Size image_size,
                                                                              Mat R,
                                                                              Mat P,
                                                                              double balance,
                                                                              Size new_size)
        Estimates new camera intrinsic matrix for undistortion or rectification.
        引数:
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        image_size - 画像のサイズ
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        R - オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネル
        P - 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)
        balance - 最小焦点距離と最大焦点距離の間の範囲で新しい焦点距離を設定する。balance は [0, 1] の範囲。
        new_size - 新しいサイズ
      • fisheye_estimateNewCameraMatrixForUndistortRectify

        public static void fisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K,
                                                                              Mat D,
                                                                              Size image_size,
                                                                              Mat R,
                                                                              Mat P,
                                                                              double balance)
        Estimates new camera intrinsic matrix for undistortion or rectification.
        引数:
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        image_size - 画像のサイズ
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        R - オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネル
        P - 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)
        balance - 最小焦点距離と最大焦点距離の間の範囲で新しい焦点距離を設定する。balance は [0, 1] の範囲。
      • fisheye_estimateNewCameraMatrixForUndistortRectify

        public static void fisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K,
                                                                              Mat D,
                                                                              Size image_size,
                                                                              Mat R,
                                                                              Mat P)
        Estimates new camera intrinsic matrix for undistortion or rectification.
        引数:
        K - カメラ内部行列 \(\cameramatrix{K}\)。
        image_size - 画像のサイズ
        D - 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。
        R - オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネル
        P - 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)の焦点距離。balance は [0, 1] の範囲。
      • fisheye_calibrate

        public static double fisheye_calibrate​(java.util.List<Mat> objectPoints,
                                               java.util.List<Mat> imagePoints,
                                               Size image_size,
                                               Mat K,
                                               Mat D,
                                               java.util.List<Mat> rvecs,
                                               java.util.List<Mat> tvecs,
                                               int flags,
                                               TermCriteria criteria)
        Performs camera calibration
        引数:
        objectPoints - キャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトル。
        imagePoints - キャリブレーションパターン点の投影のベクトルのベクトル。imagePoints.size() と objectPoints.size() は等しく、各 i について imagePoints[i].size() は objectPoints[i].size() と等しくなければならない。
        image_size - カメラ内部行列の初期化にのみ用いられる画像のサイズ。
        K - 出力される3x3の浮動小数点カメラ内部行列 \(\cameramatrix{A}\) 。REF: fisheye::CALIB_USE_INTRINSIC_GUESS が指定されている場合、fx, fy, cx, cy の一部またはすべてを関数呼び出し前に初期化しておく必要がある。
        D - 歪み係数の出力ベクトル \(\distcoeffsfisheye\)。
        rvecs - 各パターンビューに対して推定された回転ベクトル(REF: Rodrigues を参照)の出力ベクトル。すなわち、k番目の回転ベクトルは、対応するk番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンをモデル座標空間(オブジェクト点が指定される空間)からワールド座標空間へ、つまりk番目のパターンビューにおけるキャリブレーションパターンの実際の位置へと移す(k=0.. *M* -1)。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。
        flags - Different flags that may be zero or a combination of the following values:
        • REF: fisheye::CALIB_USE_INTRINSIC_GUESS cameraMatrix に fx, fy, cx, cy の有効な初期値が含まれており、それらをさらに最適化する。そうでない場合、(cx, cy) は初期値として画像中心に設定され( imageSize が使用される)、焦点距離は最小二乗法で計算される。
        • REF: fisheye::CALIB_RECOMPUTE_EXTRINSIC 内部パラメータ最適化の各反復後に外部パラメータが再計算される。
        • REF: fisheye::CALIB_CHECK_COND 関数が条件数の妥当性をチェックする。
        • REF: fisheye::CALIB_FIX_SKEW スキュー係数 (alpha) はゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_K1,..., REF: fisheye::CALIB_FIX_K4 選択した歪み係数がゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_PRINCIPAL_POINT 主点はグローバル最適化の間変更されない。中心、または REF: fisheye::CALIB_USE_INTRINSIC_GUESS も設定されている場合に指定された別の位置にとどまる。
        • REF: fisheye::CALIB_FIX_FOCAL_LENGTH 焦点距離はグローバル最適化の間変更されない。\(max(width,height)/\pi\) であるか、REF: fisheye::CALIB_USE_INTRINSIC_GUESS も設定されている場合は与えられた \(f_x\), \(f_y\) である。
        criteria - 反復最適化アルゴリズムの終了条件。
        戻り値:
        自動生成
      • fisheye_calibrate

        public static double fisheye_calibrate​(java.util.List<Mat> objectPoints,
                                               java.util.List<Mat> imagePoints,
                                               Size image_size,
                                               Mat K,
                                               Mat D,
                                               java.util.List<Mat> rvecs,
                                               java.util.List<Mat> tvecs,
                                               int flags)
        Performs camera calibration
        引数:
        objectPoints - キャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトル。
        imagePoints - キャリブレーションパターン点の投影のベクトルのベクトル。imagePoints.size() と objectPoints.size() は等しく、各 i について imagePoints[i].size() は objectPoints[i].size() と等しくなければならない。
        image_size - カメラ内部行列の初期化にのみ用いられる画像のサイズ。
        K - 出力される3x3の浮動小数点カメラ内部行列 \(\cameramatrix{A}\) 。REF: fisheye::CALIB_USE_INTRINSIC_GUESS が指定されている場合、fx, fy, cx, cy の一部またはすべてを関数呼び出し前に初期化しておく必要がある。
        D - 歪み係数の出力ベクトル \(\distcoeffsfisheye\)。
        rvecs - 各パターンビューに対して推定された回転ベクトル(REF: Rodrigues を参照)の出力ベクトル。すなわち、k番目の回転ベクトルは、対応するk番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンをモデル座標空間(オブジェクト点が指定される空間)からワールド座標空間へ、つまりk番目のパターンビューにおけるキャリブレーションパターンの実際の位置へと移す(k=0.. *M* -1)。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。
        flags - Different flags that may be zero or a combination of the following values:
        • REF: fisheye::CALIB_USE_INTRINSIC_GUESS cameraMatrix に fx, fy, cx, cy の有効な初期値が含まれており、それらをさらに最適化する。そうでない場合、(cx, cy) は初期値として画像中心に設定され( imageSize が使用される)、焦点距離は最小二乗法で計算される。
        • REF: fisheye::CALIB_RECOMPUTE_EXTRINSIC 内部パラメータ最適化の各反復後に外部パラメータが再計算される。
        • REF: fisheye::CALIB_CHECK_COND 関数が条件数の妥当性をチェックする。
        • REF: fisheye::CALIB_FIX_SKEW スキュー係数 (alpha) はゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_K1,..., REF: fisheye::CALIB_FIX_K4 選択した歪み係数がゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_PRINCIPAL_POINT 主点はグローバル最適化の間変更されない。中心、または REF: fisheye::CALIB_USE_INTRINSIC_GUESS も設定されている場合に指定された別の位置にとどまる。
        • REF: fisheye::CALIB_FIX_FOCAL_LENGTH 焦点距離はグローバル最適化の間変更されない。\(max(width,height)/\pi\) であるか、REF: fisheye::CALIB_USE_INTRINSIC_GUESS も設定されている場合は与えられた \(f_x\), \(f_y\) である。
        戻り値:
        自動生成
      • fisheye_calibrate

        public static double fisheye_calibrate​(java.util.List<Mat> objectPoints,
                                               java.util.List<Mat> imagePoints,
                                               Size image_size,
                                               Mat K,
                                               Mat D,
                                               java.util.List<Mat> rvecs,
                                               java.util.List<Mat> tvecs)
        Performs camera calibration
        引数:
        objectPoints - キャリブレーションパターン座標空間におけるキャリブレーションパターン点のベクトルのベクトル。
        imagePoints - キャリブレーションパターン点の投影のベクトルのベクトル。imagePoints.size() と objectPoints.size() は等しく、各 i について imagePoints[i].size() は objectPoints[i].size() と等しくなければならない。
        image_size - カメラ内部行列の初期化にのみ用いられる画像のサイズ。
        K - 出力される3x3の浮動小数点カメラ内部行列 \(\cameramatrix{A}\) 。REF: fisheye::CALIB_USE_INTRINSIC_GUESS が指定されている場合、fx, fy, cx, cy の一部またはすべてを関数呼び出し前に初期化しておく必要がある。
        D - 歪み係数の出力ベクトル \(\distcoeffsfisheye\)。
        rvecs - 各パターンビューに対して推定された回転ベクトル(REF: Rodrigues を参照)の出力ベクトル。すなわち、k番目の回転ベクトルは、対応するk番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンをモデル座標空間(オブジェクト点が指定される空間)からワールド座標空間へ、つまりk番目のパターンビューにおけるキャリブレーションパターンの実際の位置へと移す(k=0.. *M* -1)。
        tvecs - Output vector of translation vectors estimated for each pattern view.
        • REF: fisheye::CALIB_USE_INTRINSIC_GUESS cameraMatrix に fx, fy, cx, cy の有効な初期値が含まれており、それらをさらに最適化する。そうでない場合、(cx, cy) は初期値として画像中心に設定され( imageSize が使用される)、焦点距離は最小二乗法で計算される。
        • REF: fisheye::CALIB_RECOMPUTE_EXTRINSIC 内部パラメータ最適化の各反復後に外部パラメータが再計算される。
        • REF: fisheye::CALIB_CHECK_COND 関数が条件数の妥当性をチェックする。
        • REF: fisheye::CALIB_FIX_SKEW スキュー係数 (alpha) はゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_K1,..., REF: fisheye::CALIB_FIX_K4 選択した歪み係数がゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_PRINCIPAL_POINT 主点はグローバル最適化の間変更されない。中心、または REF: fisheye::CALIB_USE_INTRINSIC_GUESS も設定されている場合に指定された別の位置にとどまる。
        • REF: fisheye::CALIB_FIX_FOCAL_LENGTH 焦点距離はグローバル最適化の間変更されない。\(max(width,height)/\pi\) であるか、REF: fisheye::CALIB_USE_INTRINSIC_GUESS も設定されている場合は与えられた \(f_x\), \(f_y\) である。
        戻り値:
        自動生成
      • fisheye_stereoRectify

        public static void fisheye_stereoRectify​(Mat K1,
                                                 Mat D1,
                                                 Mat K2,
                                                 Mat D2,
                                                 Size imageSize,
                                                 Mat R,
                                                 Mat tvec,
                                                 Mat R1,
                                                 Mat R2,
                                                 Mat P1,
                                                 Mat P2,
                                                 Mat Q,
                                                 int flags,
                                                 Size newImageSize,
                                                 double balance,
                                                 double fov_scale)
        Stereo rectification for fisheye camera model
        引数:
        K1 - 1台目のカメラの内部行列。
        D1 - 1台目のカメラの歪みパラメータ。
        K2 - 2台目のカメラの内部行列。
        D2 - 2台目のカメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 1台目と2台目のカメラの座標系間の回転行列。
        tvec - カメラの座標系間の並進ベクトル。
        R1 - 1台目のカメラに対する出力の3x3整列変換(回転行列)。
        R2 - 2台目のカメラに対する出力の3x3整列変換(回転行列)。
        P1 - 1台目のカメラに対する、新しい(整列後の)座標系での出力の3x4投影行列。
        P2 - 2台目のカメラに対する、新しい(整列後の)座標系での出力の3x4投影行列。
        Q - 出力の \(4 \times 4\) 視差-深度マッピング行列(#reprojectImageTo3D を参照)。
        flags - ゼロまたは REF: fisheye::CALIB_ZERO_DISPARITY を取りうる操作フラグ。フラグが設定されている場合、関数は整列後のビューにおいて各カメラの主点が同じピクセル座標を持つようにする。フラグが設定されていない場合、関数は有用な画像領域を最大化するために、画像を水平方向または垂直方向(エピポーラ線の向きに依存)へなおもシフトすることがある。
        newImageSize - 整列後の新しい画像解像度。同じサイズを #initUndistortRectifyMap へ渡す必要がある(OpenCVのsamplesディレクトリにある stereo_calib.cpp のサンプルを参照)。(0,0) が渡された場合(デフォルト)、元の imageSize に設定される。より大きい値を設定すると、特に大きな放射状歪みがある場合に元画像のディテールを保持しやすくなる。
        balance - 最小焦点距離と最大焦点距離の間の範囲で新しい焦点距離を設定する。balance は [0, 1] の範囲。
        fov_scale - 新しい焦点距離の除数。
      • fisheye_stereoRectify

        public static void fisheye_stereoRectify​(Mat K1,
                                                 Mat D1,
                                                 Mat K2,
                                                 Mat D2,
                                                 Size imageSize,
                                                 Mat R,
                                                 Mat tvec,
                                                 Mat R1,
                                                 Mat R2,
                                                 Mat P1,
                                                 Mat P2,
                                                 Mat Q,
                                                 int flags,
                                                 Size newImageSize,
                                                 double balance)
        Stereo rectification for fisheye camera model
        引数:
        K1 - 1台目のカメラの内部行列。
        D1 - 1台目のカメラの歪みパラメータ。
        K2 - 2台目のカメラの内部行列。
        D2 - 2台目のカメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 1台目と2台目のカメラの座標系間の回転行列。
        tvec - カメラの座標系間の並進ベクトル。
        R1 - 1台目のカメラに対する出力の3x3整列変換(回転行列)。
        R2 - 2台目のカメラに対する出力の3x3整列変換(回転行列)。
        P1 - 1台目のカメラに対する、新しい(整列後の)座標系での出力の3x4投影行列。
        P2 - 2台目のカメラに対する、新しい(整列後の)座標系での出力の3x4投影行列。
        Q - 出力の \(4 \times 4\) 視差-深度マッピング行列(#reprojectImageTo3D を参照)。
        flags - ゼロまたは REF: fisheye::CALIB_ZERO_DISPARITY を取りうる操作フラグ。フラグが設定されている場合、関数は整列後のビューにおいて各カメラの主点が同じピクセル座標を持つようにする。フラグが設定されていない場合、関数は有用な画像領域を最大化するために、画像を水平方向または垂直方向(エピポーラ線の向きに依存)へなおもシフトすることがある。
        newImageSize - 整列後の新しい画像解像度。同じサイズを #initUndistortRectifyMap へ渡す必要がある(OpenCVのsamplesディレクトリにある stereo_calib.cpp のサンプルを参照)。(0,0) が渡された場合(デフォルト)、元の imageSize に設定される。より大きい値を設定すると、特に大きな放射状歪みがある場合に元画像のディテールを保持しやすくなる。
        balance - 最小焦点距離と最大焦点距離の間の範囲で新しい焦点距離を設定する。balance は [0, 1] の範囲。
      • fisheye_stereoRectify

        public static void fisheye_stereoRectify​(Mat K1,
                                                 Mat D1,
                                                 Mat K2,
                                                 Mat D2,
                                                 Size imageSize,
                                                 Mat R,
                                                 Mat tvec,
                                                 Mat R1,
                                                 Mat R2,
                                                 Mat P1,
                                                 Mat P2,
                                                 Mat Q,
                                                 int flags,
                                                 Size newImageSize)
        Stereo rectification for fisheye camera model
        引数:
        K1 - 1台目のカメラの内部行列。
        D1 - 1台目のカメラの歪みパラメータ。
        K2 - 2台目のカメラの内部行列。
        D2 - 2台目のカメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 1台目と2台目のカメラの座標系間の回転行列。
        tvec - カメラの座標系間の並進ベクトル。
        R1 - 1台目のカメラに対する出力の3x3整列変換(回転行列)。
        R2 - 2台目のカメラに対する出力の3x3整列変換(回転行列)。
        P1 - 1台目のカメラに対する、新しい(整列後の)座標系での出力の3x4投影行列。
        P2 - 2台目のカメラに対する、新しい(整列後の)座標系での出力の3x4投影行列。
        Q - 出力の \(4 \times 4\) 視差-深度マッピング行列(#reprojectImageTo3D を参照)。
        flags - ゼロまたは REF: fisheye::CALIB_ZERO_DISPARITY を取りうる操作フラグ。フラグが設定されている場合、関数は整列後のビューにおいて各カメラの主点が同じピクセル座標を持つようにする。フラグが設定されていない場合、関数は有用な画像領域を最大化するために、画像を水平方向または垂直方向(エピポーラ線の向きに依存)へなおもシフトすることがある。
        newImageSize - 整列後の新しい画像解像度。同じサイズを #initUndistortRectifyMap へ渡す必要がある(OpenCVのsamplesディレクトリにある stereo_calib.cpp のサンプルを参照)。(0,0) が渡された場合(デフォルト)、元の imageSize に設定される。より大きい値を設定すると、特に大きな放射状歪みがある場合に元画像のディテールを保持しやすくなる。length. Balance は [0, 1] の範囲。
      • fisheye_stereoRectify

        public static void fisheye_stereoRectify​(Mat K1,
                                                 Mat D1,
                                                 Mat K2,
                                                 Mat D2,
                                                 Size imageSize,
                                                 Mat R,
                                                 Mat tvec,
                                                 Mat R1,
                                                 Mat R2,
                                                 Mat P1,
                                                 Mat P2,
                                                 Mat Q,
                                                 int flags)
        Stereo rectification for fisheye camera model
        引数:
        K1 - 1台目のカメラの内部行列。
        D1 - 1台目のカメラの歪みパラメータ。
        K2 - 2台目のカメラの内部行列。
        D2 - 2台目のカメラの歪みパラメータ。
        imageSize - ステレオキャリブレーションに使用する画像のサイズ。
        R - 1台目と2台目のカメラの座標系間の回転行列。
        tvec - カメラの座標系間の並進ベクトル。
        R1 - 1台目のカメラに対する出力の3x3整列変換(回転行列)。
        R2 - 2台目のカメラに対する出力の3x3整列変換(回転行列)。
        P1 - 1台目のカメラに対する、新しい(整列後の)座標系での出力の3x4投影行列。
        P2 - 2台目のカメラに対する、新しい(整列後の)座標系での出力の3x4投影行列。
        Q - 出力の \(4 \times 4\) 視差-深度マッピング行列(#reprojectImageTo3D を参照)。
        flags - ゼロまたは REF: fisheye::CALIB_ZERO_DISPARITY を取りうる操作フラグ。フラグが設定されている場合、関数は整列後のビューにおいて各カメラの主点が同じピクセル座標を持つようにする。フラグが設定されていない場合、関数は有用な画像領域を最大化するために、画像を水平方向または垂直方向(エピポーラ線の向きに依存)へなおもシフトすることがある。#initUndistortRectifyMap (OpenCVのsamplesディレクトリにある stereo_calib.cpp のサンプルを参照)。(0,0) が渡された場合(デフォルト)、元の imageSize に設定される。より大きい値を設定すると、特に大きな放射状歪みがある場合に元画像のディテールを保持しやすくなる。length. Balance は [0, 1] の範囲。
      • fisheye_stereoCalibrate

        public static double fisheye_stereoCalibrate​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat K1,
                                                     Mat D1,
                                                     Mat K2,
                                                     Mat D2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs,
                                                     int flags,
                                                     TermCriteria criteria)
        Performs stereo calibration
        引数:
        objectPoints - キャリブレーションパターン点のベクトルのベクトル。
        imagePoints1 - 1台目のカメラで観測された、キャリブレーションパターン点の投影のベクトルのベクトル。
        imagePoints2 - 2台目のカメラで観測された、キャリブレーションパターン点の投影のベクトルのベクトル。
        K1 - 入力/出力の1台目のカメラの内部行列: \(\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\) , \(j = 0,\, 1\) 。REF: fisheye::CALIB_USE_INTRINSIC_GUESS , REF: fisheye::CALIB_FIX_INTRINSIC のいずれかが指定されている場合、行列成分の一部またはすべてを初期化しておく必要がある。
        D1 - 4要素の歪み係数 \(\distcoeffsfisheye\) の入力/出力ベクトル。
        K2 - 入力/出力の2台目のカメラの内部行列。パラメータは K1 と同様。
        D2 - 2台目のカメラの入力/出力レンズ歪み係数。パラメータは D1 と同様。
        imageSize - カメラ内部行列の初期化のみに使用される画像のサイズ。
        R - 1台目と2台目のカメラ座標系間の出力回転行列。
        T - カメラの座標系間の出力並進ベクトル。
        rvecs - ステレオペアの1台目のカメラの座標系において、各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>)。より詳しくは、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からステレオペアの1台目のカメラのカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からステレオペアの1台目のカメラのカメラ座標空間への基底変換を行う。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。前の出力パラメータ(rvecs)のパラメータ説明を参照。
        flags - Different flags that may be zero or a combination of the following values:
        • REF: fisheye::CALIB_FIX_INTRINSIC K1, K2 および D1, D2 を固定し、R, T 行列のみを推定する。
        • REF: fisheye::CALIB_USE_INTRINSIC_GUESS K1, K2 に fx, fy, cx, cy の有効な初期値が含まれており、それらをさらに最適化する。そうでない場合、(cx, cy) は初期値として画像中心に設定され(imageSize が使用される)、焦点距離は最小二乗法で計算される。
        • REF: fisheye::CALIB_RECOMPUTE_EXTRINSIC 内部パラメータ最適化の各反復後に外部パラメータが再計算される。
        • REF: fisheye::CALIB_CHECK_COND 関数が条件数の妥当性をチェックする。
        • REF: fisheye::CALIB_FIX_SKEW スキュー係数 (alpha) はゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_K1,..., REF: fisheye::CALIB_FIX_K4 選択した歪み係数がゼロに設定され、ゼロのまま保持される。
        criteria - 反復最適化アルゴリズムの終了条件。
        戻り値:
        自動生成
      • fisheye_stereoCalibrate

        public static double fisheye_stereoCalibrate​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat K1,
                                                     Mat D1,
                                                     Mat K2,
                                                     Mat D2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs,
                                                     int flags)
        Performs stereo calibration
        引数:
        objectPoints - キャリブレーションパターン点のベクトルのベクトル。
        imagePoints1 - 1台目のカメラで観測された、キャリブレーションパターン点の投影のベクトルのベクトル。
        imagePoints2 - 2台目のカメラで観測された、キャリブレーションパターン点の投影のベクトルのベクトル。
        K1 - 入力/出力の1台目のカメラの内部行列: \(\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\) , \(j = 0,\, 1\) 。REF: fisheye::CALIB_USE_INTRINSIC_GUESS , REF: fisheye::CALIB_FIX_INTRINSIC のいずれかが指定されている場合、行列成分の一部またはすべてを初期化しておく必要がある。
        D1 - 4要素の歪み係数 \(\distcoeffsfisheye\) の入力/出力ベクトル。
        K2 - 入力/出力の2台目のカメラの内部行列。パラメータは K1 と同様。
        D2 - 2台目のカメラの入力/出力レンズ歪み係数。パラメータは D1 と同様。
        imageSize - カメラ内部行列の初期化のみに使用される画像のサイズ。
        R - 1台目と2台目のカメラ座標系間の出力回転行列。
        T - カメラの座標系間の出力並進ベクトル。
        rvecs - ステレオペアの1台目のカメラの座標系において、各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>)。より詳しくは、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からステレオペアの1台目のカメラのカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からステレオペアの1台目のカメラのカメラ座標空間への基底変換を行う。
        tvecs - 各パターンビューについて推定された並進ベクトルの出力ベクトル。前の出力パラメータ(rvecs)のパラメータ説明を参照。
        flags - Different flags that may be zero or a combination of the following values:
        • REF: fisheye::CALIB_FIX_INTRINSIC K1, K2 および D1, D2 を固定し、R, T 行列のみを推定する。
        • REF: fisheye::CALIB_USE_INTRINSIC_GUESS K1, K2 に fx, fy, cx, cy の有効な初期値が含まれており、それらをさらに最適化する。そうでない場合、(cx, cy) は初期値として画像中心に設定され(imageSize が使用される)、焦点距離は最小二乗法で計算される。
        • REF: fisheye::CALIB_RECOMPUTE_EXTRINSIC 内部パラメータ最適化の各反復後に外部パラメータが再計算される。
        • REF: fisheye::CALIB_CHECK_COND 関数が条件数の妥当性をチェックする。
        • REF: fisheye::CALIB_FIX_SKEW スキュー係数 (alpha) はゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_K1,..., REF: fisheye::CALIB_FIX_K4 選択した歪み係数がゼロに設定され、ゼロのまま保持される。
        戻り値:
        自動生成
      • fisheye_stereoCalibrate

        public static double fisheye_stereoCalibrate​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat K1,
                                                     Mat D1,
                                                     Mat K2,
                                                     Mat D2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T,
                                                     java.util.List<Mat> rvecs,
                                                     java.util.List<Mat> tvecs)
        Performs stereo calibration
        引数:
        objectPoints - キャリブレーションパターン点のベクトルのベクトル。
        imagePoints1 - 1台目のカメラで観測された、キャリブレーションパターン点の投影のベクトルのベクトル。
        imagePoints2 - 2台目のカメラで観測された、キャリブレーションパターン点の投影のベクトルのベクトル。
        K1 - 入力/出力の1台目のカメラの内部行列: \(\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\) , \(j = 0,\, 1\) 。REF: fisheye::CALIB_USE_INTRINSIC_GUESS , REF: fisheye::CALIB_FIX_INTRINSIC のいずれかが指定されている場合、行列成分の一部またはすべてを初期化しておく必要がある。
        D1 - 4要素の歪み係数 \(\distcoeffsfisheye\) の入力/出力ベクトル。
        K2 - 入力/出力の2台目のカメラの内部行列。パラメータは K1 と同様。
        D2 - 2台目のカメラの入力/出力レンズ歪み係数。パラメータは D1 と同様。
        imageSize - カメラ内部行列の初期化のみに使用される画像のサイズ。
        R - 1台目と2台目のカメラ座標系間の出力回転行列。
        T - カメラの座標系間の出力並進ベクトル。
        rvecs - ステレオペアの1台目のカメラの座標系において、各パターンビューについて推定された回転ベクトル(REF: Rodrigues)の出力ベクトル(例: std::vector<cv::Mat>)。より詳しくは、各 i 番目の回転ベクトルは、対応する i 番目の並進ベクトル(次の出力パラメータの説明を参照)とともに、キャリブレーションパターンを物体座標空間(物体点が指定される空間)からステレオペアの1台目のカメラのカメラ座標空間へ移す。より技術的に言えば、i 番目の回転ベクトルと並進ベクトルの組は、物体座標空間からステレオペアの1台目のカメラのカメラ座標空間への基底変換を行う。
        tvecs - Output vector of translation vectors estimated for each pattern view, see parameter description of previous output parameter ( rvecs ).
        • REF: fisheye::CALIB_FIX_INTRINSIC K1, K2 および D1, D2 を固定し、R, T 行列のみを推定する。
        • REF: fisheye::CALIB_USE_INTRINSIC_GUESS K1, K2 に fx, fy, cx, cy の有効な初期値が含まれており、それらをさらに最適化する。そうでない場合、(cx, cy) は初期値として画像中心に設定され(imageSize が使用される)、焦点距離は最小二乗法で計算される。
        • REF: fisheye::CALIB_RECOMPUTE_EXTRINSIC 内部パラメータ最適化の各反復後に外部パラメータが再計算される。
        • REF: fisheye::CALIB_CHECK_COND 関数が条件数の妥当性をチェックする。
        • REF: fisheye::CALIB_FIX_SKEW スキュー係数 (alpha) はゼロに設定され、ゼロのまま保持される。
        • REF: fisheye::CALIB_FIX_K1,..., REF: fisheye::CALIB_FIX_K4 選択した歪み係数がゼロに設定され、ゼロのまま保持される。
        戻り値:
        自動生成
      • fisheye_stereoCalibrate

        public static double fisheye_stereoCalibrate​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat K1,
                                                     Mat D1,
                                                     Mat K2,
                                                     Mat D2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T,
                                                     int flags,
                                                     TermCriteria criteria)
      • fisheye_stereoCalibrate

        public static double fisheye_stereoCalibrate​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat K1,
                                                     Mat D1,
                                                     Mat K2,
                                                     Mat D2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T,
                                                     int flags)
      • fisheye_stereoCalibrate

        public static double fisheye_stereoCalibrate​(java.util.List<Mat> objectPoints,
                                                     java.util.List<Mat> imagePoints1,
                                                     java.util.List<Mat> imagePoints2,
                                                     Mat K1,
                                                     Mat D1,
                                                     Mat K2,
                                                     Mat D2,
                                                     Size imageSize,
                                                     Mat R,
                                                     Mat T)
      • fisheye_solvePnP

        public static boolean fisheye_solvePnP​(Mat objectPoints,
                                               Mat imagePoints,
                                               Mat cameraMatrix,
                                               Mat distCoeffs,
                                               Mat rvec,
                                               Mat tvec,
                                               boolean useExtrinsicGuess,
                                               int flags,
                                               TermCriteria criteria)
        Finds an object pose from 3D-2D point correspondences for fisheye camera model.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        flags - PnP問題を解くためのメソッド: REF: calib3d_solvePnP_flags を参照
        criteria - 内部の undistortPoints 呼び出しの終了条件。関数は内部で REF: undistortPoints により点の歪みを除去し、REF: cv::solvePnP を呼び出すため、入力は非常に類似している。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP を参照。
        戻り値:
        自動生成
      • fisheye_solvePnP

        public static boolean fisheye_solvePnP​(Mat objectPoints,
                                               Mat imagePoints,
                                               Mat cameraMatrix,
                                               Mat distCoeffs,
                                               Mat rvec,
                                               Mat tvec,
                                               boolean useExtrinsicGuess,
                                               int flags)
        Finds an object pose from 3D-2D point correspondences for fisheye camera model.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        flags - PnP問題を解く手法: REF: calib3d_solvePnP_flags を参照。関数は内部で REF: undistortPoints により点の歪みを除去し、REF: cv::solvePnP を呼び出すため、入力は非常に類似している。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP を参照。
        戻り値:
        自動生成
      • fisheye_solvePnP

        public static boolean fisheye_solvePnP​(Mat objectPoints,
                                               Mat imagePoints,
                                               Mat cameraMatrix,
                                               Mat distCoeffs,
                                               Mat rvec,
                                               Mat tvec,
                                               boolean useExtrinsicGuess)
        Finds an object pose from 3D-2D point correspondences for fisheye camera model.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE に使用されるパラメータ。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、さらにそれらを最適化する。関数は内部で REF: undistortPoints により点の歪みを除去し、REF: cv::solvePnP を呼び出すため、入力は非常に類似している。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP を参照。
        戻り値:
        自動生成
      • fisheye_solvePnP

        public static boolean fisheye_solvePnP​(Mat objectPoints,
                                               Mat imagePoints,
                                               Mat cameraMatrix,
                                               Mat distCoeffs,
                                               Mat rvec,
                                               Mat tvec)
        Finds an object pose from 3D-2D point correspondences for fisheye camera model.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。
        imagePoints - 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、さらにそれらを最適化する。関数は内部で REF: undistortPoints により点の歪みを除去し、REF: cv::solvePnP を呼び出すため、入力は非常に類似している。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP を参照。
        戻り値:
        自動生成
      • fisheye_solvePnPRansac

        public static boolean fisheye_solvePnPRansac​(Mat objectPoints,
                                                     Mat imagePoints,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvec,
                                                     Mat tvec,
                                                     boolean useExtrinsicGuess,
                                                     int iterationsCount,
                                                     float reprojectionError,
                                                     double confidence,
                                                     Mat inliers,
                                                     int flags,
                                                     TermCriteria criteria)
        Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        iterationsCount - 反復回数。
        reprojectionError - RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。
        confidence - アルゴリズムが有用な結果を生成する確率。
        inliers - objectPoints と imagePoints 内のインライアのインデックスを格納する出力ベクトル。
        flags - Method for solving a PnP problem: see REF: calib3d_solvePnP_flags This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
        • 点 0: [-squareLength / 2, squareLength / 2, 0]
        • 点 1: [ squareLength / 2, squareLength / 2, 0]
        • 点 2: [ squareLength / 2, -squareLength / 2, 0]
        • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        criteria - 内部の undistortPoints 呼び出しの終了条件。関数は内部で REF: undistortPoints により点の歪みを除去し、REF: cv::solvePnP を呼び出すため、入力は非常に類似している。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP を参照。
        戻り値:
        自動生成
      • fisheye_solvePnPRansac

        public static boolean fisheye_solvePnPRansac​(Mat objectPoints,
                                                     Mat imagePoints,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvec,
                                                     Mat tvec,
                                                     boolean useExtrinsicGuess,
                                                     int iterationsCount,
                                                     float reprojectionError,
                                                     double confidence,
                                                     Mat inliers,
                                                     int flags)
        Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        iterationsCount - 反復回数。
        reprojectionError - RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。
        confidence - アルゴリズムが有用な結果を生成する確率。
        inliers - objectPoints と imagePoints 内のインライアのインデックスを格納する出力ベクトル。
        flags - Method for solving a PnP problem: see REF: calib3d_solvePnP_flags This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
        • 点 0: [-squareLength / 2, squareLength / 2, 0]
        • 点 1: [ squareLength / 2, squareLength / 2, 0]
        • 点 2: [ squareLength / 2, -squareLength / 2, 0]
        • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        The function interally undistorts points with REF: undistortPoints and call REF: cv::solvePnP, thus the input are very similar. More information about Perspective-n-Points is described in REF: calib3d_solvePnP for more information.
        戻り値:
        自動生成
      • fisheye_solvePnPRansac

        public static boolean fisheye_solvePnPRansac​(Mat objectPoints,
                                                     Mat imagePoints,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvec,
                                                     Mat tvec,
                                                     boolean useExtrinsicGuess,
                                                     int iterationsCount,
                                                     float reprojectionError,
                                                     double confidence,
                                                     Mat inliers)
        Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        iterationsCount - 反復回数。
        reprojectionError - RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。
        confidence - アルゴリズムが有用な結果を生成する確率。
        inliers - Output vector that contains indices of inliers in objectPoints and imagePoints . This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
        • 点 0: [-squareLength / 2, squareLength / 2, 0]
        • 点 1: [ squareLength / 2, squareLength / 2, 0]
        • 点 2: [ squareLength / 2, -squareLength / 2, 0]
        • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        The function interally undistorts points with REF: undistortPoints and call REF: cv::solvePnP, thus the input are very similar. More information about Perspective-n-Points is described in REF: calib3d_solvePnP for more information.
        戻り値:
        自動生成
      • fisheye_solvePnPRansac

        public static boolean fisheye_solvePnPRansac​(Mat objectPoints,
                                                     Mat imagePoints,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvec,
                                                     Mat tvec,
                                                     boolean useExtrinsicGuess,
                                                     int iterationsCount,
                                                     float reprojectionError,
                                                     double confidence)
        Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        iterationsCount - 反復回数。
        reprojectionError - RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。
        confidence - The probability that the algorithm produces a useful result. This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
        • 点 0: [-squareLength / 2, squareLength / 2, 0]
        • 点 1: [ squareLength / 2, squareLength / 2, 0]
        • 点 2: [ squareLength / 2, -squareLength / 2, 0]
        • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        The function interally undistorts points with REF: undistortPoints and call REF: cv::solvePnP, thus the input are very similar. More information about Perspective-n-Points is described in REF: calib3d_solvePnP for more information.
        戻り値:
        自動生成
      • fisheye_solvePnPRansac

        public static boolean fisheye_solvePnPRansac​(Mat objectPoints,
                                                     Mat imagePoints,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvec,
                                                     Mat tvec,
                                                     boolean useExtrinsicGuess,
                                                     int iterationsCount,
                                                     float reprojectionError)
        Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        iterationsCount - 反復回数。
        reprojectionError - Inlier threshold value used by the RANSAC procedure. The parameter value is the maximum allowed distance between the observed and computed point projections to consider it an inlier. This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
        • 点 0: [-squareLength / 2, squareLength / 2, 0]
        • 点 1: [ squareLength / 2, squareLength / 2, 0]
        • 点 2: [ squareLength / 2, -squareLength / 2, 0]
        • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        The function interally undistorts points with REF: undistortPoints and call REF: cv::solvePnP, thus the input are very similar. More information about Perspective-n-Points is described in REF: calib3d_solvePnP for more information.
        戻り値:
        自動生成
      • fisheye_solvePnPRansac

        public static boolean fisheye_solvePnPRansac​(Mat objectPoints,
                                                     Mat imagePoints,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvec,
                                                     Mat tvec,
                                                     boolean useExtrinsicGuess,
                                                     int iterationsCount)
        Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。
        iterationsCount - Number of iterations. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
        • 点 0: [-squareLength / 2, squareLength / 2, 0]
        • 点 1: [ squareLength / 2, squareLength / 2, 0]
        • 点 2: [ squareLength / 2, -squareLength / 2, 0]
        • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        The function interally undistorts points with REF: undistortPoints and call REF: cv::solvePnP, thus the input are very similar. More information about Perspective-n-Points is described in REF: calib3d_solvePnP for more information.
        戻り値:
        自動生成
      • fisheye_solvePnPRansac

        public static boolean fisheye_solvePnPRansac​(Mat objectPoints,
                                                     Mat imagePoints,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvec,
                                                     Mat tvec,
                                                     boolean useExtrinsicGuess)
        Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - 出力並進ベクトル。
        useExtrinsicGuess - Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
        • 点 0: [-squareLength / 2, squareLength / 2, 0]
        • 点 1: [ squareLength / 2, squareLength / 2, 0]
        • 点 2: [ squareLength / 2, -squareLength / 2, 0]
        • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        The function interally undistorts points with REF: undistortPoints and call REF: cv::solvePnP, thus the input are very similar. More information about Perspective-n-Points is described in REF: calib3d_solvePnP for more information.
        戻り値:
        自動生成
      • fisheye_solvePnPRansac

        public static boolean fisheye_solvePnPRansac​(Mat objectPoints,
                                                     Mat imagePoints,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvec,
                                                     Mat tvec)
        Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
        引数:
        objectPoints - オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。
        imagePoints - 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。
        cameraMatrix - 入力カメラ内部行列 \(\cameramatrix{A}\)。
        distCoeffs - 歪み係数の入力ベクトル(4x1/1x4)。
        rvec - 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。
        tvec - Output translation vector. the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:
        • P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
        • REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
        • REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
        • 点 0: [-squareLength / 2, squareLength / 2, 0]
        • 点 1: [ squareLength / 2, squareLength / 2, 0]
        • 点 2: [ squareLength / 2, -squareLength / 2, 0]
        • 点 3: [-squareLength / 2, -squareLength / 2, 0]
        • それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
        The function interally undistorts points with REF: undistortPoints and call REF: cv::solvePnP, thus the input are very similar. More information about Perspective-n-Points is described in REF: calib3d_solvePnP for more information.
        戻り値:
        自動生成