Domanda

Ho due immagini catturate da due telecamere della stessa rendimento di una certa distanza a parte, catturando la stessa scena.Voglio calcolare la rotazione del mondo reale e la traduzione tra le due telecamere.Per ottenere questo, ho estratto per la prima volta le caratteristiche del setaccio di entrambe le immagini e le abbinate.

Ora ho Matrice fondamentale così come Homografia Matrix .Tuttavia incapace di procedere ulteriormente, molta confusione.Qualcuno può aiutarmi a stimare la rotazione e la traduzione tra due telecamere?

Sto usando OpenCV per l'estrazione delle funzionalità e le corrispondenti, calcoli di omost.

È stato utile?

Soluzione

Se hai l'omogografia, hai anche la rotazione.Una volta che hai l'omografia è facile ottenere rotazione e matrice di traduzione.

Ad esempio, se si utilizza 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
}
.

Questa funzione calcola la posa della fotocamera dall'omografia, in cui è contenuta la rotazione.Per ulteriori informazioni teoriche segui questa thread .

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top