Euclidean
1 of 2
file:///C:/Documents%20and%20Settings/MaIII/My%20Documents/M...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Eucliden Distance Image Processing % @author Teerapong Tanadechopon % @since 2551 Aug 28 % @notes MATLAB 2007a %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EucliPic = zeros(300); %Empty Image 200 x 200 px [m n] = size(EucliPic); %position m,n center_row = floor(m/2)+1; %center row position center_col = floor(n/2)+1; %center col position for i = 1:m, %loop for m for j = 1:n, %loop for n a = i-center_row; b = j-center_col; EucliPic(i,j)=sqrt(a^2+b^2); end end mesh(EucliPic); %plot 3D figure(2); imshow(int8(EucliPic)); title('Plot 2D Image');
10/28/2008 1:29 PM
Euclidean
2 of 2
file:///C:/Documents%20and%20Settings/MaIII/My%20Documents/M...
Published with MATLABĀ® 7.4
10/28/2008 1:29 PM