finding accuracy for charector recognition using knn
조회 수: 9 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Harsha Priya Daggubati
2020년 4월 6일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!