calculation of GLCM Mean

5 visualizaciones (últimos 30 días)
Raman
Raman el 23 de Feb. de 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?

Respuesta aceptada

Youssef  Khmou
Youssef Khmou el 23 de Feb. de 2013
Editada: Youssef Khmou el 23 de Feb. de 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 comentarios
Raman
Raman el 25 de Feb. de 2013
thank you sir
Raman
Raman el 27 de Feb. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by