file:///C|/Documents and Settings/Administrator/桌面/代码/第23章/代码23-1.txt
f=imread('peppers.png'); % 读入图像
f=rgb2gray(f); % 将彩色图像转换为灰度图像
f=im2double(f); % 转换为双精度,便于后面的计算
figure, imshow(f),title('Original Image'),
PF=edge(f,'prewitt'); % 边缘探测,算子为prewitt
figure,imshow(PF),title('Prewitt Filter');
RF=edge(f,'roberts'); % 边缘探测,算子为roberts
figure,imshow(RF),title('Roberts Filter');
LF=edge(f,'log'); % 边缘探测,算子为log
figure,imshow(LF),title('Laplacian of Gaussian (LoG) Filter');
CF=edge(f,'canny'); % 边缘探测,算子为canny
figure,imshow(CF),title('Canny Filter');
file:///C|/Documents and Settings/Administrator/桌面/代码/第23章/代码23-1.txt[2011-5-16 14:38:23]