尝试了几种常用的边缘提取方法:
BW1=edge(I5,‘sobel’); %sobel 边缘提取
BW2=edge(I5,'roberts'); %roberts边缘提取
BW3=edge(I5,'prewitt'); %prewitt边缘提取
BW4=edge(I5,'log'); %log 边缘提取
BW5=edge(I5,'canny'); %canny 边缘提取
h=fspecial('gaussian',5); %高斯滤波
BW6=edge(I5,'zerocross',[ ],h); %zerocross边缘提取
原图:
效果如下: