How to create a database of feature vectors for images?

I have a database of around 4 classes each consistent of around 50 images.I created a features vector on matlab to extract the features i need from each image.My question is how to create the database of vectors for all the images to then train them per class .

Answers (1)

N = 50 ; % number of fimages
C = 4 ; % number of classes
%%loop for each image
iwant = cell(N,C) ;
for i = 1:N
%%Extract the features of images,
iwant{i,1} = rand(10) ;
iwant{i,2} = rand(5) ;
iwant{i,3} = rand(6) ;
iwant{i,4} = rand(11) ;
end
%%Rows corresponds to each image, and columns correspon to each class of the respective image

5 Comments

Hi kssv i didn't understand the code well may you explain it showing how i extracted the features from the image and placed each features vector in an erray
How I would know the way you extracted the features? In place of rand you need to fill your feature vectors.
i mean let's say my features vector is called vect will the code change as follows? %% Extract the features of images,
iwant{i,1} = vect(10) ;
iwant{i,2} = vect(5) ;
iwant{i,3} = vect(6) ;
iwant{i,4} = vect(11) ;
end
as well as what do these numbers in vect stand for 10,5,6,11
If vec1,vec2, vec3 and vec4 are your feature vectors for image 1. Use: iwant{i,1} = vec1 ; iwant{i,2} = vec2 ; iwant{i,3} = vec3 ; iwant{i,4} = vec4; end
nope i have 1 feature vector of 110 elements i just combined all the features extraction in 1 final vector so that each image will have only 1 vector extracted of it formed of 110 elements that i then normalized and transformed to 1 element,hope that made you better understand the issue.

Sign in to comment.

Asked:

on 18 Jun 2017

Commented:

on 19 Jun 2017

Community Treasure Hunt

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

Start Hunting!