How can I solve this error? "Subscripted assignment dimension mismatch"
Mostrar comentarios más antiguos
clc;
close all;
clear all;
faceDatabase=imageSet('Database','recursive');
figure;
montage(faceDatabase(1).ImageLocation);
title('Images of single Face');
% DisplayQuery image n database...
%personQuery=1;
%GImage=read(faceDatabase(personQuery),1);
%for i=1:size(faceDatabase,2)
%end
%splitting
[training,test]=partition(faceDatabase,[0.8,0.2]);
person=3;
[features,vis]=extractHOGFeatures(read(training(person),1));
figure;
subplot(2,1,1),imshow(read(training(person),1)),title('Input Face');
subplot(2,1,2),plot(vis),title('HOG features');
% extract HOG Features of all images
trainingF=zeros(size(training,2)*training(1).Count);
featurecount=1;
for i=1:size(training,2)
for j=1:training(i).Count
trainingF(featurecount,:)=extractHOGFeatures(read(training(i),j));
trainingL{featurecount}=training(i):Description;
featurecount=featurecount+1;
end
personI{i}=training(i).Description;
end
%%for descrimination of each images..
faceClassifier=fitcecoc(trainingF,trainingL);
person=1;
queryImage=read(test(person),1);
queryFeatures=extractHOGFeatures(queryImage);
personLabel=predict(faceClassifier,queryFeatures);
%map to traingset
booleanIndex=strcmp(personLabel,personI);
integerIndex=find(booleanIndex);
subplot(1,2,1);
imshow(queryImage),title('Query Face');
subplot(1,2,2);
imshow(read(training(integerIndex),1)),title('Matched Image');
2 comentarios
Walter Roberson
el 11 de Sept. de 2015
You need to show us the exact error message indicating which line the problem is occurring on.
Image Analyst
el 11 de Sept. de 2015
Editada: Stephen23
el 11 de Sept. de 2015
Respuestas (1)
Leandro Souza
el 15 de Mayo de 2016
fix trainingF size
trainingF = zeros(size(training,2)*training(1).Count,size(feature,2));
2 comentarios
Saira
el 11 de Mzo. de 2020
How can I solve this error?
Error:
Subscripted assignment dimension mismatch
trainingL{featurecount}=training(i):Description;
Thanks
Walter Roberson
el 11 de Mzo. de 2020
The : operator is a range construction operator, and is unlikely to be correct in this context.
Categorías
Más información sobre Computer Vision Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!