Harralick feature extraction - correlation range problem
Show older comments
Hello, I am student and I am trying to learn some methods to texture discrimination. I am working on free UIUC texture database. In my program I am using this function to extract Harakick Features:
It seems to work nice, but correlation output of my pictures isn't between 0-1 range as it should be. Sometimes it's like ~700-1400. There is a sample of my code:
DatabaseSize=330; % 330 pictures
S=1;
N=11;
DB=cell(1,DatabaseSize);
PIC = 'S100%dL%d.jpg';
%I place all pictures to the table in form of 256x256 matrices, greyscale (0-255)
for i=1:DatabaseSize
DB{i}=imread(sprintf(PIC,S,N));
N=N+1;
if (N==41)
S=S+1;
N=11;
end
end
%creating glcm from jpg, grayscale picture of texture
for k=1:DatabaseSize
glcm0 = graycomatrix(DB{k}, 'offset', [0 1])
H0=haralick(glcm0);
end
Example of output:
0,0878234361108107
1,16456801470588
768,053407060767
12,6160448261336
0,645518095388608
6,63258272058824
25,9959507137929
2,12700480838163
2,83962634798163
0,0366762522066118
1,06815713592175
-0,189004327906360
0,668748281120083
Well 768 isn't for sure in range 0-1. I don't know where is the problem, because when I check the implementation of Haralicks equation or try other equations for calculating correlations I always get similar range ~1000 not 0-1. Do you know where might be the problem?
Answers (3)
Kamil
on 22 Dec 2012
1 vote
Walter Roberson
on 22 Dec 2012
0 votes
The first experiment I would do would be to im2double() the image before doing any further processing on it.
1 Comment
Image Analyst
on 22 Dec 2012
And after that, try to contact the author. None of us here know all the internal details of that File Exchange submission, nor do we have the time to dive into it, understand it, find the error (if there is one), and explain it.
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!