% ============================================================================= % Math 336 - Image Processing - Laboratory 2 % % A Matlab function for the intesity transformation... % % / L-1 for r >= L/2 % s = T(r) = | % \ 0 for r < L/2 % % Marty Kandes % Department of Physics % San Diego State University % Fall 2008 % ----------------------------------------------------------------------------- function [F] = sb(IMAGE) F = imread(IMAGE); F = mat2gray(F); [M,N] = size(F); for I = 1:M for J = 1:N if F(I,J) >= 1/2 F(I,J) = 1; else F(I,J) = 0; end; end; end; imshow(F); end