how to solve this error??? Subscripted assignment dimension mismatch. Error in traincolorceder (line 100) IHSVMEAN(imgn,:)=IHSV;
Afficher commentaires plus anciens
Plsss help me to solve this error???
Traindatabasepath='E:\PROJECT2\original\appleleaves\ceder';
Trainfiles=dir(Traindatabasepath);
Trainnum=0;
for ii=1:size(Trainfiles,1)
if not(strcmp(Trainfiles(ii).name,'.')|strcmp(Trainfiles(ii).name,'..')|strcmp(Trainfiles(ii).name,'Thumbs.db'))
Trainnum=Trainnum+1;
end
end
imgccount=1;
for imgn=1:Trainnum
img=imread(strcat(Traindatabasepath,'\',num2str(imgn),'.jpg'));
% imshow(i);
% j=imresize(i,[256 256]);
% figure,imshow(j);
[r c]=size(img);
%global feature extraction
HSV=rgb2hsv(img);
H=HSV(:,:,1);
S=HSV(:,:,2);
V=HSV(:,:,3);
HM=mean(H(:));
SM=mean(S(:));
VM=mean(V(:));
k=1;
[r1 c1]=size(H);
for m=1:8:r1-7
for n=1:8:c1-7
BH=H(m:m+7,n:n+7);
BS=S(m:m+7,n:n+7);
BV=V(m:m+7,n:n+7);
BHM=mean(BH(:));
BSM=mean(BS(:));
BVM=mean(BV(:));
BMN=[BHM BSM BVM]';
BMEAN(k,:)=BMN;
k=k+1;
end
end
IH=zeros(k-1,1);
IS=zeros(k-1,1);
IV=zeros(k-1,1);
for p=1:k-1
if (BMEAN(p,1)>=HM)
IH(p)=1;
end
if (BMEAN(p,1)>=SM)
IS(p)=1;
end
if (BMEAN(p,3)>=VM)
IV(p)=1;
end
end
% IHSV=[IH IS IV]';
%IHSVMEAN(imgn,:,:)=IHSV;
IHSV=[IH' IS' IV'];
IHSVMEAN(imgn,:)=IHSV;
end
save colorlocal IHSVMEAN
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!