How to normalize GLCMs created for four offsets?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am using Matlab 2019b to extract texture features of images using gray level co-occurrence matrix (glcm). I have written the following code to extract rotation invariant features with directions 0, 45, 90, 135. The code creates four glcms and every feature has four values; one per direction.
I = imread('test.jpg')
offsets = [0 1; -1 1;-1 0;-1 -1];
glcm = graycomatrix(I, 'GrayLimits', [], 'Offset',offsets);
stats = graycoprops(glcm);
I want to normalize the glcms then extract each feature from the normalized glcms.
Any help is greatly appreciated.
2 comentarios
Image Analyst
el 22 de Mzo. de 2020
Not sure what you want. Do you just want this
glcm = glcm / sum(glcm(:));
or
glcm = glcm / max(glcm(:));
or
glcm = rescale(glcm, 0, 1);
Mohammad Farhad Aryan
el 23 de Mzo. de 2020
Editada: Mohammad Farhad Aryan
el 24 de Mzo. de 2020
Respuestas (2)
Image Analyst
el 24 de Mzo. de 2020
Regarding your last comment above . . .It told you it's not integer and it needs integer. So, cast it to integer:
uint8Image = uint8(rescale(rgb2gray(mskRgbImg), 0, 255));
Then pass that into graycomatrix().
See my attached glcm demo.
3 comentarios
Image Analyst
el 25 de Mzo. de 2020
So don't normalize it. Why do you think each should be normalized? If each is normalized independently then how can you compare them?
Hend Abouche
el 8 de Abr. de 2022
Editada: Image Analyst
el 8 de Abr. de 2022
Hello, I am working on texture features extraction and I want to ask you why you didn't use just the function graycomatrix in a simple way, but you used the offset. Did you do it so you can specify the pixels that you want to calculate their co-occurrence?
5 comentarios
nissrine Neyy
el 23 de Jun. de 2022
Hi @Image Analyst, i have a question in the same context, what's the difference between using symmetric and not (set it to false or true), i know how it works but in term of results which is better and what does it give or add as an information ?
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!