Couture 2 images dans opencv

Je suis en train d'assembler 2 images juste pour le début de panography. J'ai déjà trouvé des keypoints, trouvé homographie à l'aide de RANSAC, mais je ne peux pas comprendre comment aligner ces 2 images (je suis nouveau à opencv). Maintenant la partie de code

vector<Point2f> points1, points2;
for( int i = 0; i < good_matches.size(); i++ )
{
    //-- Get the keypoints from the good matches
    points1.push_back( keypoints1[ good_matches[i].queryIdx ].pt );
    points2.push_back( keypoints2[ good_matches[i].trainIdx ].pt );
}

/* Find Homography */
Mat H = findHomography( Mat(points2), Mat(points1), CV_RANSAC );

/* warp the image */
warpPerspective(mImg2, warpImage2, H, Size(mImg2.cols*2, mImg2.rows*2), INTER_CUBIC);

et j'ai besoin de point Mat mImg1 où est chargé de la première image et Mat warpImage2 où est le warped deuxième image. Pouvez-vous pls me montrer comment faire? J'ai aussi le warped couper l'image et je sais que je dois changer la matrice d'homographie, mais pour l'instant j'ai besoin d'aligner ces deux images. Je vous remercie pour votre aide.

Edit: Avec Martin Beckett aider j'ai ajouté ce code

//Point a cv::Mat header at it (no allocation is done)
Mat final(Size(mImg2.cols*2 + mImg1.cols, mImg2.rows*2),CV_8UC3);

//velikost img1
Mat roi1(final, Rect(0, 0,  mImg1.cols, mImg1.rows));
Mat roi2(final, Rect(0, 0, warpImage2.cols, warpImage2.rows));
warpImage2.copyTo(roi2);
mImg1.copyTo(roi1);
imshow("final", final);

et ça fonctionne maintenant

OriginalL'auteur Bodyboard | 2011-11-20