How to check if there is a shift in the images, and output the shift in terms of values
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi , I have 2 gray images having very slight differences, I want to check if there is shift or change in between those 2 images. How can I do that.I used normx2corr command and get the corr_offset, but its always 0 0 , where as there is a difference in the images.Any help or advice would be appreciated.
im1 = imread('image1.png');
im2 = imread('image2.png');
im1a=rgb2gray(im1);
im2a=rgb2gray(im2);
cc = normxcorr2(im1a,im2a);
[max_cc, imax] = max(abs(cc(:)));
[ypeak, xpeak] = ind2sub(size(cc),imax(1));
corr_offset_1 = [ (ypeak-size(im1a,1)) (xpeak-size(im1a,2)) ]
output -->corr_offset =
0 0
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!