aquí quiero comparar si la imagen coincide con otra o no ... ¿cómo resolverla?

Aquí está mi código:

function check
    i1=imread('cricketteam.jpg');
    [y,x,d]=size(i1);
    m=imread('musfiq.jpg');
    [y1,x1,d]=size(m);
    x2=1;
    y2=1;
    row_match=0;
    flag_y=0;
    cx=1;
    xc=1;
    xc1=1;
    counter=0;
    counter1=0;
    s_loop=x-x1;
    k=0;
    s_loop= s_loop+1;
    for i=1:y
       cx=xc;

        for j=cx:x
            disp(i)
            disp(j)
            counter1=counter1+1;
            if j==s_loop && row_match==0
                break;
            end
            f=impixel(m,x2,y2);
            disp(f)

            ma=impixel(i1,j,i);

            disp(ma)
            d=[155 165 128];
            if ma==d
               k=1;


            end
            if isequal(f,ma)==1
                disp('Image Matched')
                 if  row_match == 0
                    xc=cx;
                 end
                row_match=row_match+1;
                x2=x2+1;
            else

                  flag_y=0;
                  row_match=0;
                  y2=1;
                  x2=1;

            end
            if row_match==x1
                  flag_y=flag_y+1;
                  row_match=0;
                  y2=y2+1;
                  x2=1;
                  break;
            end

        end
       counter=counter+1;
        if  flag_y==y1
            disp('Image Matched')
            break;
        end
    end
    disp(k)
    disp(counter)
    disp(counter1)
end

Respuestas a la pregunta(0)

Su respuesta a la pregunta