Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Stitching 2 image with findHomography

Hi, i have troubles to stitching two image using findHomography and warpPerspective, my code is the next one:

Mat H = findHomography(obj, scene, CV_RANSAC);

Mat warpImage2;
warpPerspective(im2, warpImage2, H, Size(im2.cols, im2.rows), INTER_CUBIC, BORDER_TRANSPARENT);

Mat final(Size(im2.cols * 2 , im2.rows), CV_8UC3);

Mat roi1(final, Rect(0, 0, im.cols, im.rows));
Mat roi2(final, Rect(im.cols, 0, im2.cols, im2.rows));

warpImage2.copyTo(roi2);
im.copyTo(roi1);
imshow("final", final);

the problem is that the result is the next one:

http://imgur.com/hgAr1AB

I can move my roi manually and try and try untill stitching both but when i'll use that function for other image will not work.

There a form to stitching them without move de roi manually?

Thanks.