calculation of GLCM Mean

3 vues (au cours des 30 derniers jours)
Raman
Raman le 23 Fév 2013
i,ve gone through the tutorial
http://www.fp.ucalgary.ca/mhallbey/glcm_mean.htm
i've divided the image into discrete blocks.i want to calculate the GLCM Mean of every block... can u tell me by writing code of glcm Mean...
glcm=graycomatrix(input_image);
this i know...
what i dont know is the GLCM Mean.. can anybody tell me the synrtax for it?

Réponse acceptée

Youssef  Khmou
Youssef Khmou le 23 Fév 2013
Modifié(e) : Youssef Khmou le 23 Fév 2013
hi Jassy ,
there is an answer ( to check ...) in previous question, i repost it here anyway for further discussion/correction with other Contributers :
I=imread('liftingbody.png');
G=graycomatrix(I);
[m n]=size(G);
GLCMl=0 % left hand side mean
GLCMr=0; % right hand side mean
for x=1:m
for y=1:n
GLCMl=GLCMl+x*G(x,y);
GLCMr=GLCMr+y*G(x,y);
end
end
The difference between the two is 111.
  2 commentaires
Raman
Raman le 25 Fév 2013
thank you sir
Raman
Raman le 27 Fév 2013
[rows columns]=size(input_image);
glcml=0;
glcmr=0;
glcmL=[];
glcmR=[];
blockSizeR = 32;% Rows in block.
blockSizeC = 32; % Columns in block.
for row = 1 : blockSizeR : rows
for col = 1 : blockSizeC : columns
row1 = row;
row2 = row1 + blockSizeR - 1;
row2 = min(rows, row2);
col1 = col;
col2 = col1 + blockSizeC - 1;
col2 = min(columns, col2);
oneBlock = grayImage(row1:row2, col1:col2);
subplot(8,8,blockNumber);
imshow(oneBlock);
glcm=graycomatrix(oneBlock);
for x=1:wholeBlockRows
for y=1:wholeBlockCols
glcml=glcml+x*glcm(x,y);
glcmr=glcmr+y*glcm(x,y);
glcmL(blockNumber)=glcml;
caption=sprintf('\nGLCM Mean along left of #%d is %d',blockNumber,glcmL(blockNumber));
disp(caption);
glcmR(blockNumber)=glcmr;
caption1=sprintf('\nGLCM Mean along right of #%d is %d',blockNumber,glcmR(blockNumber));
disp(caption1);
blockNumber = blockNumber + 1;
end
end
here, i've divided the image into discrete blocks of 8x8. Here m calculating the GLCM MEAN of every block. can u tell me the output(GLCM Mean)it produces is correct or not corresponding to each block..as m not able to identify as it is correct or not.
i'll be very thankful to u
reply soon

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Computer Vision with Simulink dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by