Unable to run bag of features

Technical Source
2 min readJan 7, 2022

I have a 8gb ram and whenever I tried to run bagOfFeatures, it always says out of memory. Please see below.

Error using vertcat
Out of memory. Type HELP MEMORY for your options.
Error in bagOfFeatures/extractDescriptorsFromSet (line 578)
descriptors = [descriptors; tempDescriptors]; %#ok
Error in bagOfFeatures (line 207)
scores{categoryIndex}] = this.extractDescriptorsFromSet(imgSets(categoryIndex), params);

May I know how can I resolve this issue? Thanks.

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

The error occurs because bagOfFeatures is extracting features from all of your training images and storing them in memory. This is a simple strategy for collecting the features, but does have the downside of requiring lots of memory.

If you’re using the ‘Grid’ point selection method, then you can try increasing the GridStep parameter [32 32], which will reduce the number of locations within the image where features are extracted. In addition to that, you can try reducing the number of blocks using the ‘BlockWidth’ parameter, for example, set it to [64 96].

Another common strategy to avoid this type of problem with large datasets is to sub-sample the number of features extracted from the training images.

You can see the M-code by editing the example: edit(‘exampleBagOfFeaturesExtractor.m’)

This example uses the same feature extraction method that the bagOfFeatures uses by default.

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.