imgSets = imageSet('folder','recursive');
[imgSets.Count]
minSetCount = min([imgSets.Count]);
trainingSets = partition(imgSets, minSetCount, 'randomize');
[trainingSets.Count]
bag = bagOfFeatures(trainingSets,'Vocabularysize',100,'Pointselection','Detector');
img = read(imgSets(1), randi(imgSets(1).Count));
featureVector = encode(bag, img);
figure(1)
subplot(3,2,1); imshow(img);
subplot(3,2,2);
bar(featureVector); title('Visual Word Occurrences'), xlabel('Visual Word Index'); ylabel('Frequency of occurrences');
img = read(imgSets(2), randi(imgSets(2).Count));
featureVector = encode(bag, img);
figure(1)
subplot(3,2,3); imshow(img);
subplot(3,2,4);
bar(featureVector); title('Visual Word Occurrences'), xlabel('Visual Word Index'); ylabel('Frequency of occurrences');
img = read(imgSets(3), randi(imgSets(3).Count));
featureVector = encode(bag, img);
figure(1)
subplot(3,2,5); imshow(img);
subplot(3,2,6);
bar(featureVector); title('Visual Word Occurrences'), xlabel('Visual Word Index'); ylabel('Frequency of occurrences');
categoryClassifier = trainImageCategoryClassifier(trainingSets, bag);
2 Comments
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/425020-how-to-check-after-completing-the-image-processing-machine-learning-program#comment_624989
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/425020-how-to-check-after-completing-the-image-processing-machine-learning-program#comment_624989
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/425020-how-to-check-after-completing-the-image-processing-machine-learning-program#comment_624990
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/425020-how-to-check-after-completing-the-image-processing-machine-learning-program#comment_624990
Sign in to comment.