首页 > 其他 > 详细

梯度算子检测边缘用.m

时间:2015-05-12 15:38:22      阅读:191      评论:0      收藏:0      [点我收藏+]
%梯度算子检测边缘用 MATLAB实现如下: 
clc;clear;close;
I=imread('e:\role0\003i.bmp'); 
subplot(2,3,1); 
imshow(I); 
title('原始图像'); 
grid on;                  %显示网格线 
axis on;                  %显示坐标系 
I1=im2bw(I); 
subplot(2,3,2);
imshow(I1);
title('二值图像');
grid on;                  %显示网格线 
axis on;                  %显示坐标系 
I2=edge(I1,'roberts'); 
figure; 
subplot(2,3,3); 
imshow(I2); 
title('roberts算子分割结果');
grid on;                  %显示网格线 
axis on;                  %显示坐标系 
I3=edge(I1,'sobel'); 
subplot(2,3,4); 
imshow(I3);
title('sobel算子分割结果'); 
grid on;                  %显示网格线 
axis on;                  %显示坐标系
I4=edge(I1,'Prewitt'); 
subplot(2,3,5); 
imshow(I4); 
title('Prewitt算子分割结果 ');
grid on;                  %显示网格线 
axis on;                  %显示坐标系

梯度算子检测边缘用.m

原文:http://blog.csdn.net/whk100312/article/details/45639929

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!