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