How to create a features vector after extracting them from an Image?

I extracted color features like mean,standard deviation,variance etc...note that i extracted from different color spaces like RGB,HSV,YCbCr and extracted the same features for each color plane,R,G,B,H,...etc.. and texture features like correlation,contrast,energy etc..note that i used GLCM to extract my texture features and i did that for 4 orientations so some of my texture features is a 1D 4 elements vector. How can i create 1 final vector that summarizes everything for an image and which way/ways could be used so i can actually find out what features matter most so i can increase their weights accordingly or get rid of the least important.

 Accepted Answer

String them all together:
featureVector = [var1, var2, var3, ..... etc.]
It might help to normalize all variables to the range 0-1 so that one is not overly influential just because it has a higher value.

4 Comments

Should i normalize by dividing the each element to it's norm which is the square root of the sum of the square of each element or do you recommmend any in-built functions. then should i use "cat" to group them. And finally any idea how i know which features contribute most in a successful classification.
You might use mat2gray() which normalized arrays to the range 0-1. You can use cat() if you want. I'm a little fuzzy on how to determine "importance" of the various features - that's a stats question. I remember doing step-wise regression once is the Mathworks stats toolbox class to determine which features are really needed, but I don't have the coursebook with me and I didn't remember. I'm sure there's some kind of function in the stats toolbox to figure it out though. Take a look at the stepwise() function in the Statistics and Machine Learning help.
so i took this example
tb=[22.9 30.0 30.3 27.8 24.1 28.2 26.4 12.6 39.7 38.0];
normalized_V = tb/norm(tb);
I = mat2gray(tb);
to check the difference results i'll get and for normalized_v i got 0.2503 0.3280 0.3312 0.3039 0.2635 0.3083 0.2886 0.1377 0.4340 0.4154
for I i got 0.3801 0.6421 0.6531 0.5609 0.4244 0.5756 0.5092 0 1.0000 0.9373 which one should i use and why
They do different things. Either might be okay. The thing is you want to avoid values in your feature vector that are like orders of magnitude different from each other.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!