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

    %% Calculate Symmetric GLCM for Grayscale Image
% 
%%
% Read grayscale image into the workspace.
I = imread('circuit.tif');
%%
% Calculate GLCM using the |Symmetric| option. The GLCM created when you set
% |Symmetric| to true is symmetric across its diagonal, and is equivalent to
% the GLCM described by Haralick (1973). 
glcm = graycomatrix(I,'Offset',[2 0],'Symmetric', true)