5

同じメーカーの2台のカメラから撮影した2つの画像を少し離して配置し、同じシーンを撮影しました。2台のカメラ間の実際の回転と平行移動を計算したいと思います。これを実現するために、私は最初に両方の画像のSIFT特徴を抽出し、それらを一致させました。

これで、基本行列ホモグラフィ行列ができました。しかし、それ以上先に進むことができず、多くの混乱があります。誰かが2台のカメラ間の回転と平行移動を推定するのを手伝ってもらえますか?

特徴抽出とマッチング、ホモグラフィ計算にOpenCVを使用しています。

4

1 に答える 1

5

あなたがホモグラフィを持っているなら、あなたはローテーションも持っています。ホモグラフィができたら、回転と変換行列を簡単に取得できます。

たとえば、OpenCV c ++を使用している場合:

param[in] H
param[out] pose
void cameraPoseFromHomography(const Mat& H, Mat& pose)
{
    pose = Mat::eye(3, 4, CV_32FC1);      // 3x4 matrix, the camera pose
    float norm1 = (float)norm(H.col(0));  
    float norm2 = (float)norm(H.col(1));  
    float tnorm = (norm1 + norm2) / 2.0f; // Normalization value

    Mat p1 = H.col(0);       // Pointer to first column of H
    Mat p2 = pose.col(0);    // Pointer to first column of pose (empty)

    cv::normalize(p1, p2);   // Normalize the rotation, and copies the column to pose

    p1 = H.col(1);           // Pointer to second column of H
    p2 = pose.col(1);        // Pointer to second column of pose (empty)

    cv::normalize(p1, p2);   // Normalize the rotation and copies the column to pose

    p1 = pose.col(0);
    p2 = pose.col(1);

    Mat p3 = p1.cross(p2);   // Computes the cross-product of p1 and p2
    Mat c2 = pose.col(2);    // Pointer to third column of pose
    p3.copyTo(c2);       // Third column is the crossproduct of columns one and two

    pose.col(3) = H.col(2) / tnorm;  //vector t [R|t] is the last column of pose
}

この関数は、回転が含まれているホモグラフィからカメラのポーズを計算します。さらなる理論的情報については、このスレッドに従ってください。

于 2012-09-30T11:24:24.507 に答える