finding accuracy for charector recognition using knn
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
faceClassifier = fitcknn(trainingFeatures,trainingLabel);
%testing
kk=1;
for charector=1:47
for j = 1:test(charector).Count
queryImage = read(test(charector),j);
queryFeatures = extractHOGFeatures(queryImage);
actualLabel = predict(faceClassifier,queryFeatures);
actualLabel=char(actualLabel);
predictedLabel=test(charector).Description;
al(kk)=actualLabel(2:length(actualLabel));//error:Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
pl(kk)=predictedLabel(2:length(predictedLabel)) ;
iam doing charector recognition using knn, i used the above code for extracting features and classification ,when i tried to find out the accuracy of the classification i got an error(Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.) in one of the statement like above mentioned.Actually i have used 47 charectors that includes 47 folders one for each charector that is named charector1......charector47.Each folder contains around 200 different forms of writting.Hope anybody can suggest optimal solution that can solve the error
0 commentaires
Réponses (1)
Harsha Priya Daggubati
le 6 Avr 2020
Hi,
The error you mentioned is due to assignment you are trying to make. To be clear:
kk=1;
a= 1:10
al(1) = a(2:end);
The above code gives the same error too!
Assuming you wish to store all the actual and predicted labels, you can use cell array and store the values by appending to al in each iteration.
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!