This demo explains how to perform scene classification using Bag Of Features and Machine Learning in MATLAB. This follows along with the video demonstration: https://www.mathworks.com/videos/image-recognition-using-machine-learning-122900.html
Johanna Pingel (2019). Image Recognition using Machine Learning Demo (https://www.mathworks.com/matlabcentral/fileexchange/62193-image-recognition-using-machine-learning-demo), MATLAB Central File Exchange. Retrieved .
Create scripts with code, output, and formatted text in a single executable document.
Sushil Kandel (view profile)
Ashley-Maacah Muflam (view profile)
The downloaded code uses actualSceneType = actualSceneType = test_set.Labels;
but the code in the video uses actualSceneType = categorical(repelem({test_set.Description}', [test_set.Count], 1));
monica mane (view profile)
I am getting the following error
Undefined variable "trainedClassifier" or class "trainedClassifier.RequiredVariables".
Error in Scene_Identification (line 100)
testSceneData = array2table(testSceneData,'VariableNames',trainedClassifier.RequiredVariables);
Dhilsath Fathima (view profile)
Ketan Shende (view profile)
Also,
The following line is different in the code provided to us and the code which you are explaining in the video
actualSceneType = test_set.Labels;
Ketan Shende (view profile)
I am getting the following error
Undefined variable "trainedClassifier" or class "trainedClassifier.RequiredVariables".
Error in Scene_Identification (line 100)
testSceneData = array2table(testSceneData,'VariableNames',trainedClassifier.RequiredVariables);
Alan Peters (view profile)
There is an error in this code that occurs at least twice. Instead of
%% Create Visual Vocabulary
tic
bag = bagOfFeatures(training_set,...
'VocabularySize',250,'PointSelection','Detector');
scenedata = double(encode(bag, training_set));
toc
use
%% Create Visual Vocabulary
tic
bag = bagOfFeatures(imageSet(training_set.Files),...
'VocabularySize',250,'PointSelection','Detector');
scenedata = double(encode(bag,imageSet(training_set.Files)));
toc