Matlab CERR coocurrence matrix (GLCM) code

1 view (last 30 days)
Laura Romero Crespo
Laura Romero Crespo on 10 Sep 2022
Answered: Akash on 13 Sep 2023
In order to obtain the GLCM I need to quantize the scan matrix and specify a number of gray levels or bins. However I don't know how to obtain them or if I have to use the number of gray levels specified in the github wiki (https://github.com/cerr/CERR/wiki/Quantize-scan-matrix).

Answers (1)

Akash
Akash on 13 Sep 2023
Hi Laura,
I understand that you are working on obtaining the "Gray-Level Co-occurrence Matrix (GLCM)" in MATLAB, and you need to specify the number of gray levels or bins. However, you are unsure about how to determine the appropriate number of gray levels for your specific application.
The number of gray-levels or bins determines the size of the "Gray-Level Co-occurrence Matrix (GLCM)". The default number of gray levels is "8" for numeric images and "2" for logical images.
Finding the optimal number of gray levels is typically part of the research process and depends on the specific characteristics of your data and the classification task at hand.
To gain further insights into the considerations for selecting the number of gray levels, I recommend referring to the following discussion link:
Additionally, to understand how the number of gray levels is used for scaling in the code fragment inside the "graycomatrix.m" function, you can refer to the following link. It will be helpful to determine number of gray levels as per the required scaling.
Thanks,
Akash.

Tags

Community Treasure Hunt

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

Start Hunting!