function [asm] = ASM(I, d,phi) % % Written by: % -- % John L. Weatherwax 2005-08-04 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % % Epage % %----- if( nargin>1 ) % compute the ASM for just one displacement and angular direction P = co_occurrence(I, d,phi); P2 = P.^2; asm = sum(P2(:)); else % compute the CON for all angles and average d = 1; % assume d=1 all_phis = [ 0, 45, 90, 135 ]; all_asms = zeros(1,length(all_phis)); for ii=1:length(all_phis) a = ASM(I, d,all_phis(ii)); % recursively call the three argument case all_asms(ii) = a; end asm = mean(all_asms); end