필터 지우기
필터 지우기

how to stitch two images with overlapped area?

조회 수: 6 (최근 30일)
Mahnaz Pariyan
Mahnaz Pariyan 2013년 12월 5일
댓글: Mahnaz Pariyan 2013년 12월 8일
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!

채택된 답변

Image Analyst
Image Analyst 2013년 12월 8일
See Chapters 9 and 10 of Richard Szileski's book: http://szeliski.org/Book/ which discuss this topic.

추가 답변 (2개)

Omair
Omair 2013년 12월 5일
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
Omair
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
Mahnaz Pariyan 2013년 12월 5일
here i got some problems:
in calculating the homography matrix ,in the code i used, it is written that the input points must be 2xN matrices, if they are same as i have as "matches" and "scores", then one of them is 2x202 and the other one is 1x202. I thought by zero-padding the problem would be solved, and i added another row to the "scores" matrix.
now for applying the homography matrix on the image coordinates, i get no error actually, but the result is a 3x7596 matrix, which seems to be wrong.

댓글을 달려면 로그인하십시오.


Omair
Omair 2013년 12월 5일
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.

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by