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

    %% Calculate GLCMs using Four Different Offsets
% 
%%
% Read grayscale image into the workspace.
I = imread('cell.tif');
%%
% Define four offsets.
offsets = [0 1; -1 1;-1 0;-1 -1]; 
%%
% Calculate the GLCMs, returning the scaled image as well.
[glcms, SI] = graycomatrix(I,'Offset',offsets);
%%
% Note how the function returns an array of four GLCMs.
whos