%Sobel,LoG和Canny边缘检测器的比较
f=imread('building.tif');%读取图像
subplot(4,2,1),imshow(f),title('原图像')
[g_sobel_default,ts]=edge(f,'sobel');%sobel边缘检测
subplot(4,2,3),imshow(f),title('默认的sobel图像')
[g_log_default,tlog]=edge(f,'log');%log边缘检测
subplot(4,2,5),imshow(f),title('默认的log图像')
[g_canny_default,tc]=edge(f,'canny');%canny边缘检测
subplot(4,2,7),imshow(f),title('默认的canny图像')
g_sobel_best=edge(f,'sobel',0.05);%最好的sobel检测
subplot(4,2,4),imshow(f),title('最好的sobel图像')
g_log_best=edge(f,'log',0.003,2.25);%最好的log检测
subplot(4,2,6),imshow(f),title('最好的log图像')
g_canny_best=edge(f,'canny',[0.04 0.10],1.5);%最好的canny检测
subplot(4,2,8),imshow(f),title('最好的canny图像')
Sobel,LoG和Canny边缘检测器的比较
最新推荐文章于 2024-05-27 11:21:43 发布