matlab 垂直边缘检测,matlab 边缘检测

一、没有噪声时的检测结果

1 原始图像

2 Sobel算子边缘检测

3 Prewitt算子边缘检测

4 Roberts算子边缘检测

5 Laplace算子边缘检测

6 Canny算子边缘检测

二、加入高斯噪声(μ=0,σ^2=0.01)检测结果

1 原始图像

2 Sobel算子边缘检测

3 Prewitt算子边缘检测

4 Roberts算子边缘检测

5 Laplace算子边缘检测

6 Canny算子边缘检测

三、加入高斯噪声(μ=0,σ^2=0.02)检测结果

1 原始图像

2 Sobel算子边缘检测

3 Prewitt算子边缘检测

4 Roberts算子边缘检测

5 Laplace算子边缘检测

6 Canny算子边缘检测

I =

imread('lena.bmp'); %%如果是其他类型图像,请先转换为灰度图

1、

%%没有噪声时的检测结果

BW_sobel = edge(I,'sobel');

BW_prewitt = edge(I,'prewitt');

BW_roberts = edge(I,'roberts');

BW_laplace = edge(I,'log');

BW_canny = edge(I,'canny');

figure(1);

subplot(2,3,1),imshow(I),xlabel('原始图像');

subplot(2,3,2),imshow(BW_sobel),xlabel('sobel检测');

subplot(2,3,3),imshow(BW_prewitt),xlabel('prewitt检测');

subplot(2,3,4),imshow(BW_roberts),xlabel('roberts检测');

subplot(2,3,5),imshow(BW_laplace),xlabel('laplace检测');

subplot(2,3,6),imshow(BW_canny),xlabel('canny检测');

2、

%%加入高斯噪声(μ=0,σ^2=0.01)检测结果

I_g1 = imnoise(I,'gaussian',0,0.01);

BW_sobel = edge(I_g1,'sobel');

BW_prewitt = edge(I_g1,'prewitt');

BW_roberts = edge(I_g1,'roberts');

BW_laplace = edge(I_g1,'log');

BW_canny = edge(I_g1,'canny');

figure(2);

subplot(2,3,1),imshow(I_g1),xlabel('加入高斯噪声(μ=0,σ^2=0.01)图像');

subplot(2,3,2),imshow(BW_sobel),xlabel('sobel检测');

subplot(2,3,3),imshow(BW_prewitt),xlabel('prewitt检测');

subplot(2,3,4),imshow(BW_roberts),xlabel('roberts检测');

subplot(2,3,5),imshow(BW_laplace),xlabel('laplace检测');

subplot(2,3,6),imshow(BW_canny),xlabel('canny检测');

3、

%%加入高斯噪声(μ=0,σ^2=0.02)检测结果

I_g2 = imnoise(I,'gaussian',0,0.02);

BW_sobel = edge(I_g2,'sobel');

BW_prewitt = edge(I_g2,'prewitt');

BW_roberts = edge(I_g2,'roberts');

BW_laplace = edge(I_g2,'log');

BW_canny = edge(I_g2,'canny');

figure(3);

subplot(2,3,1),imshow(I_g2),xlabel('加入高斯噪声(μ=0,σ^2=0.02)图像');

subplot(2,3,2),imshow(BW_sobel),xlabel('sobel检测');

subplot(2,3,3),imshow(BW_prewitt),xlabel('prewitt检测');

subplot(2,3,4),imshow(BW_roberts),xlabel('roberts检测');

subplot(2,3,5),imshow(BW_laplace),xlabel('laplace检测');

subplot(2,3,6),imshow(BW_canny),xlabel('canny检测');

浏览网页时,看到整理得很好,故转发于此。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值