I followed digit classification examples using hog features. At, last I successfully created a classifier. Now, I want to predict the labels of a single image. So, I tried:
imgTest = imread('imageThree-0279.png');lvl = graythresh(imgTest);imgTest = im2bw(imgTest, lvl);testFeatures = extractHOGFeatures(imgTest,'Cellsize', cellSize);%%Make class predictions using the test features.
[lblIdx,scores] = predict(classifier, testFeatures);classifier.Labels(lblIdx);
But, I got error: Error using subsref No appropriate method, property, or field 'Labels' for class 'ClassificationECOC'.
Soon, I realized that 'ClassificationECOC' doesn't contain any field 'Labels'. So then, what should I used. I can see that 'lblIdx' holds ans '3' in workspace. But, how can i display the labels? Any help would be appreciated.
Best Answer