How do you compare the two images using MATLAB program

How do you compare the two images using MATLAB program I am on my project retrieve images and you write code comparison between images using correlation, but there is a problem in the code does not give me incorrect results for comparison please help
count=0;
t=0;
x=imread('D:\Image Retrieval\2.bmp');
a=rgb2gray(x);
srcFiles = dir('D:\Image Retrieval\*.bmp'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('D:\Image Retrieval\',srcFiles(i).name);
k = imread(filename);
count=count+1;
b=rgb2gray(k);
c=corr2(a,b);
if c==1
imwrite(k,'C:\Users\saba\Desktop\images\image1.jpg');
t=t+1;
else
disp('tow image are not simalr');
end
end

3 件のコメント

Geoff Hayes
Geoff Hayes 2016 年 2 月 16 日
Jasmine - what results are you getting? What do you expect the results to be? Note that you are comparing the output of corr2 to one which is not always valid especially when using single or double precision numbers. What values of c do you observe?
Jasmine collar
Jasmine collar 2016 年 2 月 19 日
I am working on image retrieval system and use the correlation way in the comparison process But when you compare the results must be 100% identical images to know that the twosimaged are similar
Explorer
Explorer 2016 年 2 月 19 日
編集済み: Explorer 2016 年 2 月 19 日
Are you taking same two images as input? If you are doing so, your statement make sense.
Please delete it.

サインインしてコメントする。

回答 (1 件)

Nitin Mishra
Nitin Mishra 2020 年 1 月 23 日
編集済み: Walter Roberson 2020 年 1 月 23 日

0 投票

I am too working on same project where 5 images of group photos would be given and I need to find out the a person in the image which the user will ask for using a different single image of that particular person.... is there any way then please help me out...

カテゴリ

質問済み:

2016 年 2 月 16 日

編集済み:

2020 年 1 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by