function [rln] = RLN(I, 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 RLN for just one displacement and angular direction Q = Q_RL(I,phi); tmp = sum( Q, 1 ); num = sum( tmp.^2 ); den = sum(Q(:)); rln = num/den; else % compute the RLN for all angles and average all_phis = [ 0, 45, 90, 135 ]; all_rlns = zeros(1,length(all_phis)); for ii=1:length(all_phis) a = RLN(I,all_phis(ii)); % recursively call the three argument case all_rlns(ii) = a; end rln = mean(all_rlns); end