Comparing two images by corr2 function

Posted by user3696860 on Stack Overflow See other posts from Stack Overflow or by user3696860
Published on 2014-06-01T15:23:15Z Indexed on 2014/06/01 15:24 UTC
Read the original article Hit count: 172

Filed under:

I'm trying to compare two images by corr2 function on Matlab, it's not necess getting 1 end of function so I am using a treshold to find best images among template images. But sometimes it evaluate wrong image. How can I process them to find best match?

`

temp=[];
for i=1:10
    res=sprintf('%d.png',i)
    yol=fullfile('cember\taslak_cember\',res);  
    a=imread(yol);
    b=imread('30_1.png');
    a=rgb2gray(a);
    b=rgb2gray(b);
    a=im2bw(a,0.4);
    b=im2bw(b,0.4);
    c=corr2(a,b);
    temp=[temp c];
end
max(temp)
`

© Stack Overflow or respective owner

Related posts about matlab