here i want to compare whether to image match with other or not…how to solve it?

这一生的挚爱 提交于 2019-12-04 05:51:56

问题


here is my code:

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

来源:https://stackoverflow.com/questions/37819252/here-i-want-to-compare-whether-to-image-match-with-other-or-not-how-to-solve-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!