如何使用matlab将8灰度级更改为32级灰度级(GLCM)

时间:2017-11-09 15:21:14

标签: matlab image-processing glcm

我想将8灰度级更改为32级灰度,我试图在我的图像中使用8灰度级,但值如下:

here is the result

所以我想尝试使用32灰度级:

this is my image

这是我的代码

I = imread('001 A.png');
gray = rgb2gray(I);
offsets = [0 1;-1 1;-1 0;-1 -1];
[GLCMS,SI] = graycomatrix(gray,'Of', offsets);  
stats = graycoprops(GLCMS,
{'contrast','homogeneity','correlation','energy'});

也许有人可以帮助我

提前致谢

1 个答案:

答案 0 :(得分:0)

Numlevel设为32

I = imread('001 A.png');
gray = rgb2gray(I);
offsets = [0 1;-1 1;-1 0;-1 -1];
[GLCMS,SI] = graycomatrix(gray, 'Of', offsets, 'Numlevel', 32);  
stats = graycoprops(GLCMS, {'contrast','homogeneity','correlation','energy'});