Image quantization is an important step for feature extraction through GLCM. Although there are many questions related to this but there is no proper answer for Quantization problem in MATLAB.
I am using this code:
i= imread('image');
g=rgb2gray(i);
levels=multithresh(g,7);
A=imquantize(g, levels);
B = uint8(A);
glcm=graycomatrix(B, 'offset', [-1 0]);
stats = graycoprops(glcm);

4 Kommentare

KALYAN ACHARJYA
KALYAN ACHARJYA am 17 Feb. 2021
Sir, more specific question?
Junaid Dar Dar
Junaid Dar Dar am 17 Feb. 2021
When I use Quantized image (B) in code like "glcm=graycomatrix(B,'offset', [-1 0]". It does not give solution.
But when I use Grayscale image (g) in code it give some solution, but it is not good approach.
KALYAN ACHARJYA
KALYAN ACHARJYA am 17 Feb. 2021
Bearbeitet: KALYAN ACHARJYA am 17 Feb. 2021
"code it give some solution?
Can you share the objective?
B have only 8 levels, whereas g have 256 levels.
Junaid Dar Dar
Junaid Dar Dar am 17 Feb. 2021
My objective is to get statistical features of an image using GLCM. But as you may know, for this purpose we have to quantize image to 4 or 8 graysclae so that we can use it in GLCM. But when I quantize my image 'g' to 'B' and use it in graycomatrix, it doesnot give solution.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Gefragt:

am 17 Feb. 2021

Kommentiert:

am 17 Feb. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by