Steven Wang's Blog
C'est la vie
rss
email
twitter
新浪微博
  • Home
  • About
  • Google Profile
  • 新浪微博

在Matlab中使用Roberts算子进行边缘检测

2 Comments
Posted on 十月 25 2009

Roberts边缘检测算子是图像处理中最基本的边缘检测算子,其认为任意一对相互垂直方向上的差分可以看成是梯度的近似求解,采用对角线方向相邻两像素之差,
即某一像素点(i,j)的Roberts算子值为:f(x)=|f(i,j)-f(i+1,j+1)|+|f(i+1,j)-f(i,j+1)|

下面给出在matlab中使用Robert算子进行边缘检测的实现,文章末尾提供了相关资源的下载。

sourcePic=imread('D:\Lena.jpg'); %读取原图象
grayPic=rgb2gray(sourcePic); %转换成灰度图象
newGrayPic= grayPic;
[m,n]=size(grayPic);
robertsNum=0; %roberts算子的计算值
threshold=15; %阈值
for i=1:m-1 %进行边界提取
	for j=1:n-1
		robertsNum = abs(grayPic(i,j)-grayPic(i+1,j+1)) + abs(grayPic(i+1,j)-grayPic(i,j+1));
		if(robertsNum > threshold)
			newGrayPic(i,j)=255;
		else
			newGrayPic(i,j)=0;
		end
	end
end
figure,imshow(newGrayPic);

原始图像及提取边界后的图像如下:

原始lena图像 提取边界后的lena图像

Roberts算子提取的边缘较粗,对噪声很敏感,并且需要手动的指定一个阈值(threshold),对不同的图像使用不同的阈值后,边界提取效果差别很大。因此Roberts算子还有很多值得改进的地方,文章末尾提供了一篇关于自适应阈值的参考论文下载。使用自适应的阈值,并对提取的边缘进行细化处理,能有效地改善Roberts算子的边界提取效果。

还有很多其他的边界提取算子,如:Prewitt算子,Sobel算子,Canny算子,Log算子等,不同的算子有各自的优点,对这些算子的提取效果和执行效率的改进是图像处理方 面的热点问题。

Resources & Reference:
1、一种新的目标图像自适应阈值分割算法.pdf
2、数字图像处理与分析—用Roberts算子提取图象边界(含matlab代码).doc
3、演示处理图片:lena.bmp
4、ALL Files

--End--
作者:Steven Wang | 可以转载, 转载时务必以超链接形式标明文章原始出处和作者信息及版权声明
网址:http://blog.stevenwang.name/roberts-operator-edge-matlab-3003.html

Relate Posts:

  • 在Matlab中实现RGB颜色空间转换为Lab颜色空间
  • Matlab7.1读xvid编码的avi视频文件
  • 在Matlab中实现图像直方图均衡化
  • 在Matlab中实现Hough变换检测直线

Tags: matlab  Roberts算子  边缘检测 
Categories: 数字图像处理 

2 Comments

  1. 飞仙飘雪 says:
    四月 30 2010 at 09:51 Reply

    真不错 能有更多资源吗?怎么只有Roberts算法,而没有其他几种呢

  2. Steven Wang says:
    四月 30 2010 at 11:05 Reply

    @飞仙飘雪:其他几种算法步骤都类似,只是算子不一样,就没有一一举例了。

Leave a Reply



About Me

    Steven Wang
    Student in Computer Software and Theory
    Life@Wuxi, Jiangsu
    Study@Jiangnan University
    more...

Feeds

  • Entries (RSS)
  • Comments (RSS)
  • 订阅到 Google Reader
  • 订阅到 抓虾
  • 订阅到 鲜果
  • 订阅到 QQ

Popular Posts

  • 围着脖子推GTalk机器人V1.0发布(27299)
  • 通过SSH + Chrome + Proxy Switchy!代理上网(19678)
  • 在GAE上部署Micolog博客系统(11307)
  • 围着脖子推V2.0 Beta1版发布 支持Twitter,新浪微博,人人网,嘀咕,做啥 同步更新(11060)
  • 围着脖子推GTalk机器人V1.0更新-增加接收Twitter更新等功能(10663)
  • 围着脖子推更新-增加同步更新网易微博、腾讯微博和搜狐微博(10483)
  • 在Matlab中实现Hough变换检测直线(8448)
  • Micolog主题(theme) —— translucence(7842)

Recent Posts

  • Steven Wang's 2011
  • 工作
  • T400升级Intel SSD
  • Java中的时区转换小结
  • 二值图像连通区标记之区域生长法
  • Steven Wang's 2010
  • 微博提醒应用上线
  • 双喜临门

Recent Comments

  • Queen:加油。...
  • Queen:hi,我来打个招呼,深圳的朋友。...
  • yu :@Steven Wang, p<...
  • ixwebhosting:文章总结的好潇洒,即将对末来学生生活说声...
  • john:希望新的一年更加美好...

Categories

  • Google App Engine(10)
  • 数字图像处理(11)
  • Micolog(7)
  • VPS(6)
  • 围着脖子推(15)
  • 人工神经网络(5)
  • 算法(11)
  • MyLife(16)
  • 媒体检索(4)
  • Others(8)
  • Python(2)

Archives

  • January 2012(1)
  • December 2011(2)
  • May 2011(1)
  • February 2011(1)
  • December 2010(3)
  • November 2010(1)
  • October 2010(1)
  • September 2010(4)
  • August 2010(2)
  • July 2010(5)
  • June 2010(4)
  • May 2010(7)

Blog roll

  • ~Issue
  • Fenng
  • 刘未鹏 | Mind Hacks
  • 林海听松
  • Yu Zheng
  • Johnny Han
  • 静静的安静
  • Dbger
  • land of promise
  • 星星
  • ISHENS|TECH
  • 天天软件园
  • leezhenchong's blog
  • 苏洋博客

  • Home
  • About
  • Google Profile
  • Twitter
  • 新浪微博
  • Login
Powered by Google App Engine  |   Designed by WebTreats  |   由 xuming 提供 Micolog程序