File Exchange

image thumbnail

Scenes/Objects classification toolbox

version (19.5 MB) by Sebastien PARIS
Scenes recognition toolbox for vision systems


Updated 25 Apr 2011

View Version History

View License

Scenes/Objects Rocognition toolbox v0.12
This toolbox provides some basic tools for scenes/object recognition in vision systems.
Based on supervised classification, this toolbox offerts some state-of-art descriptors coupled with fast and efficient classifiers.
Descriptors are divided in two famillies:
i) "direct" features computed from images [1,2,3,4,5,19],
ii) "dictionnary learning + spatial pooling" features computed from a collection of patches:
a) Bag of Features [6,7] and
b) Sparse Dictionary learning [8,9].
Large-Scale Linear SVM such Liblinear [10] or Pagasos [11] are used to train models since features are almost perfectly linearly separable.
Non-linear Kernels extension for additive homogeneous kernels (chi2, intersection histogram, etc...) is performed through features map method [12,22].
The main objective of this toolbox is to deliver simple but efficient tools, easy to modify, mainly written in C codes with a matlab interface.

Please open readme.txt for full instructions

Cite As

Sebastien PARIS (2021). Scenes/Objects classification toolbox (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (28)


Dear Sebastien,I followed your instruction file "readme.txt" to install the toolbox, and after running the file "setup_reco_toolbox.m", I was prompted to run a demo, with an error in running the file "extract_bag_of_features.m." The variable 'dltrain' is not defined.

Ridhi Arora


jinting zhu

Hi,Sébastien,is it the dltrain.c missing ?


thanks for your excellent work,but please update this to the new version as you said on 2013.

hamed abdulaziz

Dear Sebastien, Can you please guide me how to use this excellent toolbox to classify the medical image into two classes : abnormal and normal ? Thanks in advance.

Sebastien PARIS


With this toolbox and the totally new version that I hope to publish within 1 month, you can retrieve results of more that 50 papers in image categorization...

Ranju Mandal

Dear Sebastien, Can you please send me the link of the paper where u have described the method in details?

a das

hi can you say me when I am running the code simple_train.m its giving a error undefined variable X. Can pls solve it????

Sebastien PARIS

Zbingos... How big is your dataset ?. How many images?. In my current version now everything is passing trough a file so requiering low memory for a just a slight slowdown ..


A> choice_descriptors = [1]; %mlhoee_spyr=1/mlhmslsd_spyr=2/mlhmslbp_spyr=3/mlhmsldp_spyr=4

a> case [2]:
Subscripted assignment dimension mismatch.

Error in extract_direct_features (line 85)
X(: , co) = descriptors(I ,

b> case [1]:
Crash out of memory (maybe cause i run it in a 32bit matlab ?)

B> You have right i did not extract the proper descriptor.

Thanks a lot and sorry for the delay in replying.

Sebastien PARIS


The version of the toolbox is old compare to my current one. I have to update it I know ... but have to spend of time to check compatibility, debugging etc... In the new version you have

i) New local features: HLBP/HLTP/DV, etc..
ii) New encoders/pooler: LCC, Local sparse coding, Fisher vector, lp-norm pooling
iii) cascade up to 3 layers
iv) cross-training capacity

Everything have been redesign completly compared to the current one...

Actually I don't have time to do this update, hope within 1 month... Please understand.
To asnwer to your question:
1) what are the 1 et 2 choices ?

2) norm is a vector (1 x 3). norm(1) for the all concatenated vector, norm(2), for all current level of the pyramid, norm(3) for each individual ROI where you are pooling

3) Did you extract first the corresponding descriptor ?


Hi sebastian,

1. I can not run the "extract_bag_of_features" for the "1" and "2" choice of descriptors. ?

2. Some demo m files does not run so i change the norm from number to matrix e.g: [1,0,0]. Is it right or not?

3. The simple_train.m does not run. The error is this:
Load descriptor scenes15_denseSIFT_mlhbow_spyr for classifier = liblinear

Error using load
Unable to read file 'C:\C_DISC\codes\KARA\3
reco_toolbox\reco_toolbox\features\scenes15_denseSIFT_mlhbow_spyr': no such file or

Error in simple_train (line 145)
load(fullfile(feat_dir , base_name ));

Thanks for your help~time.


Hi Sébastien, Thanks for the info! But I did not notice any major changes to the ldp code... Are there traumatic differences?


Dear Sebastian,
Thank you for sharing this remarkable toolbox!
I've just installed the toolbox and run the bag_of_features.m, but unfortunately, en error was reported. It said that "Undefined function 'dltrain' for input argument of type 'struct'."
Error in extract_bag_of_features (line 229)
D(: , : , s , c) = encoding(X(: , indexdico) ,

Could you please so kind to help me with this little problem? I am really an new hand in this area...
Best wishes!


Sebastien PARIS


1) For large database, I'll plan to use the new functionalities of Matlab 2011b to append/load partially from a file.

2) It's a good idea to separate the datasets. I'll make the modification in the incoming major update of this toolbox

Venkat R

Dear Sebastian,
I was using your extract_bag_of_features.m for my object classification. If possible, can you help me in following problems I am facing...
1. For a database of size 50,000 samples, there is Out of memory problems coming...
2. Can I use the dictionary built on one database, for encoding another database(s). I will normalize all images to a standard size of 50x50 and keep the SIFT parameters also the same.

thanking you,

with regards,

Sebastien PARIS


I am working on a big update of this toolbox with a lot of new things, stay in touch so ...

Sebastien PARIS


Please visit the SPAMS webpage (, compile the lib with your current system and copy the associate requiered files such mexlasso, mexTrainDL, mexTrainDLmemory in the /core dir of my toolbox

Ishrat Badami

Dear Sebastian,
I installed the toolbox as instructed on Ubuntu 10.04 32bit. While running the file extract_bag_of_features.m I get error message
??? Invalid MEX-file
'/home/ishrat/Uni_Bonn/Semester_2/Graphics_2/graphics_lab/Matlab/reco_toolbox/core/mexLasso.mexglx': cannot open shared object file: No such file or directory.

Error in ==> dl_spyr at 77
G = full(abs(mexLasso(X(: , index) , D(: , : , s , c) ,
options)))'; %(np x K)
I also unzip the in core folder. Am I missing something? Please help I am totally stuck.
Thanks in advance


yes, one for each derivative direction. I could output the one for 0 degrees.

Sebastien PARIS


There are in fact 4 LDP images ...
Maybe I will add an option for display them.


Hi again. Thank you for your answer. Assuming one would like to see the LDP image, is there a way to output it using your function, or a variable in your function? Thanks!

Sebastien PARIS

Leila. This normalization is often used in computer vision. See Maji'papers for example.


Dear Sébastien,
Thanks for your answer. I have another question: in the normalization type 3, you normalize the square of the L1 norm, why?

Sebastien PARIS

I use the same convention than in the Zhang paper.

ldporient Orientation for ldp computation (1 x norient), where norient <= 4 and ldporient(i) = {0,1,2,3}
ldporient(i) = 0 <=> (I(x_1+1,y_1)-I(x_1,y_1))*(I(x_0+1,y_0)-I(x_0,y_0))< 0
ldporient(i) = 1 <=> (I(x_1+1,y_1+1)-I(x_1,y_1))*(I(x_0+1,y_0+1)-I(x_0,y_0))< 0
ldporient(i) = 2 <=> (I(x_1,y_1+1)-I(x_1,y_1))*(I(x_0,y_0+1)-I(x_0,y_0))< 0
ldporient(i) = 3 <=> (I(x_1-1,y_1+1)-I(x_1,y_1))*(I(x_0-1,y_0+1)-I(x_0,y_0))< 0
(default ldporient = [0 , 1 , 2 , 3])



Dear Sébastien,
Thanks for this helpful code.
Where you specify ldporient, how do (x_1,y_1) and (x_0,y_0) correspond to neighborhood pixels in the original paper [Zhang et al, 2010]?

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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!