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

29 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

Comments and Ratings (5)

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

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor