Implementing Edge Detection in MATLAB

clearall;
clc;
closeall;
i=imread('cameraman.tif');
 bw1=edge(i,'canny');
 bw2=edge(i,'prewitt');
 bw3=edge(i,'sobel');
figure(1);                     
subplot(2,2,1);
imshow(i);
title('original image');
subplot(2,2,2);
imshow(bw1);
title('canny image');
subplot(2,2,3);
imshow(bw2);
title('prewitt image');
subplot(2,2,4);
imshow(bw3);
title('sobel image');

Output

Output

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.