please I have a problem in this code i want to convert an image and to compare it with other images:
function Couleur_Callback(hObject, eventdata, handles)global a; disp (a); I1=rgb2gray(a); histo=imhist(I1); r=dir('base'); [I c]=size(r); j=1; for i=3:1 ch1=r(i).name; disp(ch1); img=stract('base\',ch1); disp(img); imagetestt=imread(img); imagetest2=rgb2gray( imagetestt); imagetest=imhist(imagetest2); valeur=intersectionhisto(histo,imagetest); resulat(j)=valeur; j=j+1; end resultatFinal=sort(resulat,'descend') for i=1:j-1 X=find(resultatFinal(i)==resultat) indice(i)=X(1); end for i=1:6 nomImage=stract('base\',num2str(indice(i)),'.jpg'); I=imread(nomImage); subplot(6,1,i); imshow(I); end
Best Answer