canny边缘检测
I=imread('lena.bmp'); %读灰度图lena.bmp
%Canny edge detector
th=[0.05 0.2];
E=edge(I,'canny',th);
E=uint8(255*(1-double(E)));
figure('name','canny'),imshow(uint8(E),'truesize');
sobel边缘检测
I=imread('lena.bmp'); %读灰度图lena.bmp
%sobel edge detector
E=edge(I,'sobel',0.08);
E=uint8(255*(1-double(E)));
figure('name','canny'),imshow(uint8(E),'truesize');
%小波去噪:
thr=10,sorth='s';
crit='shannon';
keepapp=0;
x2=wpdencmp(x1,sorth,'sym4',crit,thr,keepapp);
%小波边缘检测
x3=edge(x1,'prewitt');
最主要的就是这几句,其他都是浮云。
灰度化I=rgb2gray(I);
任务大,不想做。给你个网址,你去搜吧:
http://www.pudn.com;
http://www.csdn.net;