用MATLAB对图像进行边缘检测的代码也给我一份呗,谢谢你
2012-06-12
展开全部
I=imread('peppers.bmp');
BW1=edge(I,'roberts');
[BW1,thresh1]=edge(I,'roberts');
figure;
%subplot(1,2,1);
imshow(BW1);
BW1=edge(I,'roberts',0.05);
figure;
%subplot(1,2,2);
imshow(BW1);
BW2=edge(I,'sobel');
figure;
%subplot(1,3,1);
imshow(BW2);
[BW2,thresh2]=edge(I,'sobel');
BW2=edge(I,'roberts',0.05,'horizontal');
figure;
%subplot(1,3,2);
imshow(BW2);
BW2=edge(I,'roberts',0.05,'vertical');
%subplot(1,3,3);
imshow(BW2);
BW3=edge(I,'prewitt');
figure;
subplot(1,3,1);imshow(BW3);
[BW3,thresh3]=edge(I,'prewitt');
BW3=edge(I,'roberts',0.05,'horizontal');
subplot(1,3,2);imshow(BW3);
BW3=edge(I,'prewitt',0.05,'vertical');
subplot(1,3,3);imshow(BW3);
BW1=edge(I,'roberts');
[BW1,thresh1]=edge(I,'roberts');
figure;
%subplot(1,2,1);
imshow(BW1);
BW1=edge(I,'roberts',0.05);
figure;
%subplot(1,2,2);
imshow(BW1);
BW2=edge(I,'sobel');
figure;
%subplot(1,3,1);
imshow(BW2);
[BW2,thresh2]=edge(I,'sobel');
BW2=edge(I,'roberts',0.05,'horizontal');
figure;
%subplot(1,3,2);
imshow(BW2);
BW2=edge(I,'roberts',0.05,'vertical');
%subplot(1,3,3);
imshow(BW2);
BW3=edge(I,'prewitt');
figure;
subplot(1,3,1);imshow(BW3);
[BW3,thresh3]=edge(I,'prewitt');
BW3=edge(I,'roberts',0.05,'horizontal');
subplot(1,3,2);imshow(BW3);
BW3=edge(I,'prewitt',0.05,'vertical');
subplot(1,3,3);imshow(BW3);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询