Revision as of 04:59, 14 October 2009 by Apanja (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

%%%%%%%%%%%%%%%%%% CODE FOR THE AVERAGE & EDGE DETECTOR FILTERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



clear all; close all; clc; u=imread('londonbridge.jpg');

I=rgb2gray(u); [r,c]= size(I) I(1,1)=0; for j=1:r

   for i=2:(c-1)
       I_avg_filter(j,i+1)=(I(j,i)+I(j,i+1))/2;
     
   end
   

end


for j=1:r

   for i=2:(c-1)
       I_edge_detector(j,i+1)=(I(j,i)-I(j,i+1));
     
   end
   

end subplot(3,2,1); imshow(u); title('Original Image'); subplot(3,2,2); imshow(I); title('Original Image in Gray scale'); subplot(3,2,3); imshow(I_avg_filter); title('Image using Average Filter'); subplot(3,2,4); imshow(I_edge_detector); title('Image using Edge Detector'); --Apanja 09:59, 14 October 2009 (UTC)Ananya Panja

Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang