how to stitch two images with overlapped area?
显示 更早的评论
hi
i am using SIFT algorithm with vl_sift (and other functions) to find matched points in two images, that has overlapping area. now that i have the match points, how can i transform the second image and stitch it to the first one. from what i read in different papers, i conclude that i have to create mask to do this, but then what to do with the mask?
here is my code: (of course incomplete, i need now to stitch these two pics together)
f1 = imread('IMG_0148.jpg');
f2 = imread('IMG_0149.jpg');
f1 = im2single(rgb2gray(f1));
f2 = im2single(rgb2gray(f2));
[h1,d1] = vl_sift(f1) ;
[h2,d2] = vl_sift(f2) ;
[matches, scores] = vl_ubcmatch(d1, d2) ;
Thanks!
采纳的回答
更多回答(2 个)
Omair
2013-12-5
0 个投票
I'm assuming you are trying to create a panorama from these two images. For that you will need to calculate the homography and transform one image into the plane of the other image before you can stitch them together.
5 个评论
Mahnaz Pariyan
2013-12-5
Omair
2013-12-5
Have you calculated the homography matrix yet? I think that would be needed to transform one image coordinates into the plane of the other.
Mahnaz Pariyan
2013-12-5
Omair
2013-12-5
Now you need to transform your pixel coordinates to the pixel coordinates of the other image plane by multiplying with the homography matrix, not the pixel values but the pixel coordinates. This will tell you where the particular pixel value belongs in the other image plane.
Mahnaz Pariyan
2013-12-5
Omair
2013-12-5
0 个投票
Have a look at these slides ( http://www.gris.tu-darmstadt.de/teaching/courses/ss13/cv1/slides/l10-geometry.pdf), slide 15 onwards . For calculating the homography matrix you have 8 unknows. You need 4 feature point correspondences between your two images to solve for those 8 unknows. From those you calculate the homography matrix.
类别
在 帮助中心 和 File Exchange 中查找有关 SIFT - Scale Invariant Feature Transform 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!