error-different values for same image

3 views (last 30 days)
kash
kash on 21 Jan 2012
I am performing feature extraction,i have 80 images in data base,i am extracting 3 features,and have saved ,them,next am taking first image from that 80 images and have extracted same features .and have saved it.
wen i compare i get different same values for 2 feature extraction and for third feature extraction ,i get different values
the feature extraction aye
two colours and one texture
the code for texture is
g=rgb2gray(I);
rgb=mean(mean(I));
r1=rgb(:,:,1);
g1=rgb(:,:,2);
b1=rgb(:,:,3);
std1=std2(g);
entropy1=entropy(g);
tres=graythresh(g);
glcm=graycomatrix(g);
F=graycoprops(glcm,{'Contrast','Homogeneity','Correlation','Energy'});%graycoprops(glcm, properties)
%calculates the statistics specified in properties from the gray-level co-occurence matrix glcm
contrast=F.Contrast;
homogeneity=F.Homogeneity;
correlation=F.Correlation;
energy=F.Energy;
final_tex=[contrast,homogeneity,correlation,energy];
final_textq=final_tex;
save('final_text_Query', 'final_textq');
FinalOut2_Query = final_tex
please help

Answers (2)

Walter Roberson
Walter Roberson on 4 Feb 2012
There is no reason to expect that different features will always give the same value. Feature extraction uses multiple features. When you do CBIR you match against the multiple features and come up with a majority or "most matches" or consensus decision knowing that not every feature will match.

Image Analyst
Image Analyst on 4 Feb 2012
Either your image is not the same like you thought it was, or you ran a different piece of code on the same image. Because running the same set of code on the same image will give the same result, unless you somehow used a function call to a random number generator (like rand, randi, randperm, etc.).

Community Treasure Hunt

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

Start Hunting!