File Exchange

image thumbnail

Image Recognition using Machine Learning Demo

version 1.0.0.0 (2.32 KB) by Johanna Pingel
The code from the video: Image Recognition Using Machine Learning

64 Downloads

Updated 27 Mar 2017

View License

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

Cite As

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 .

Comments and Ratings (7)

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

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);

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;

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

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

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux