www.gusucode.com > images 案例代码 matlab源码程序 > images/CreateGrayLevelCooccurrenceMatrixReturningScaledImageExample.m

    %% Create Gray-Level Co-occurrence Matrix Returning Scaled Image
% 
%%
% Create a simple 3-by-6 sample array.
I = [ 1 1 5 6 8 8; 2 3 5 7 0 2; 0 2 3 5 6 7]
%%
% Calculate the gray-level co-occurrence matrix (GLCM) and return the
% scaled image used in the calculation. By specifying empty brackets for
% the |GrayLimits| parameter, the example uses the minimum and maximum
% grayscale vales in the input image as limits. 
[glcm, SI] = graycomatrix(I,'NumLevels',9,'GrayLimits',[])