How to check if there is a shift in the images, and output the shift in terms of values

6 次查看(过去 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 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by