% Matlab function % Applies an intensity Mask to an image % The effect of an intensity mask is to make 0 all gray value % intensities of the image which are between given limits. % Jose A. Rodriguez Serrano 2002 % Matlab code 6.1.0.450 (R12.1) function y=IntensityMask(A, lo, hi); dims=size(A); width=dims(1); height=dims(2); clear dims; % Apply mask for i=1:width, for j=1:height, if (A(i,j)hi) y(i,j)=0; else y(i,j)=A(i,j); end end end