分享你我的资源分享我们的人生!

用matlab实现分水岭算法

free code for watershed algorithm

2008-07-19
分水岭算法的概念及原理 分水岭分割方法,是一种基于拓扑理论的数学形态学的分割方法,其基本思想是把图像看作是测地学上的拓扑地貌,图像中每一点像素的灰度值表示该点的海拔高度,每一个局部极小值及其影响区域称为集水盆,而集水盆的边界则形成分水岭。分水岭的概念和形成可以通过模拟浸入过程来说明。在每一个局部极小值表面,刺穿一个小孔,然后把整个模型慢慢浸入水中,随着浸入的加深,每一个局部极小值的影响域慢慢向外扩展,在两个集水盆汇合处构筑大坝,即形成分水岭。 分水岭的计算过程是一个迭代标注过程。分水岭比较经典的计算方法是L. Vincent提出的。在该算法中,分水岭计算分两个步骤,一个是排序过程,一个是淹没过程。首先对每个像素的灰度级进行从低到高排序,然后在从低到高实现淹没过程中,对每一个局部极小值在h阶高度的影响域采用先进先出(FIFO)结构进行判断及标注。 分水岭变换得到的是输入图像的集水盆图像,集水盆之间的边界点,即为分水岭。显然,分水岭表示的是输入图像极大值点。因此,为得到图像的边缘信息,通常把梯度图像作为输入图像,即 g(x,y)=grad(f(x,y))={[f(x,y)-f(x-1,y)]2[f(x,y)-f(x,y-1)]2}0.5 式中,f(x,y)表示原始图像,grad{.}表示梯度运算。 分水岭算法对微弱边缘具有良好的响应,图像中的噪声、物体表面细微的灰度变化,都会产生过度分割的现象。但同时应当看出,分水岭算法对微弱边缘具有良好的响应,是得到封闭连续边缘的保证的。另外,分水岭算法所得到的封闭的集水盆,为分析图像的区域特征提供了可能。 为消除分水岭算法产生的过度分割,通常可以采用两种处理方法,一是利用先验知识去除无关边缘信息。二是修改梯度函数使得集水盆只响应想要探测的目标。 为降低分水岭算法产生的过度分割,通常要对梯度函数进行修改,一个简单的方法是对梯度图像进行阈值处理,以消除灰度的微小变化产生的过度分割。即 g(x,y)=max(grad(f(x,y)),gθ) 式中,gθ表示阈值。 程序可采用方法:用阈值限制梯度图像以达到消除灰度值的微小变化产生的过度分割,获得适量的区域,再对这些区域的边缘点的灰度级进行从低到高排序,然后在从低到高实现淹没的过程,梯度图像用Sobel算子计算获得。对梯度图像进行阈值处理时,选取合适的阈值对最终分割的图像有很大影响,因此阈值的选取是图像分割效果好坏的一个关键。缺点:实际图像中可能含有微弱的边缘,灰度变化的数值差别不是特别明显,选取阈值过大可能会消去这些微弱边缘。
源代码下载: 下载位置Code SoSo    DOWNLOAD


相关论文

标记分水岭算法及区域合并的遥感图像分割

SEGMENTATION OF THE REMOTE SENSING IMAGE BASED ON METHOD OF LABELING WATERSHED ALGORITHM AND REGIONAL MERGING

陈波[1,2] 张友静[2] 陈亮[1,2]

传统的分水岭算法通常对梯度图像进行无标记分割,其结果是容易造成过度分割。本文采用了一种基于标记的分水岭算法,首先,利用Sobel边缘算子对原遥感图像进行梯度重建,获得梯度幅值图像,同时计算待分割区域的周长、面积和形态因子,并对其进行标记;然后,利用距离函数图标定种子法和等值线跟踪法获得初始分割图像;最后,利用改进的区域合并方法获得最终的分割结果。实验结果表明了该方法的有效性。[著者文摘]

Segmentation of gradient images in the traditional watershed algorithm usually has no markers, which is likely to cause excessive segmentation. This paper presents a watershed algorithm based on the label. First, the gradient images are obtained through the reconstruction of gradient by using Sobel operator and, at the same time, the perimeter, area and morphology factors of the region are computed and labeled. Then, the initial image of segmentation is acquired by using the method of distance function icon for determining the seeds and the technique of isoline tracking. Finally, the last result of segmentation is obtained by using an improved method of regional merging. The experimental result shows the effectiveness of the method.[著者文摘]

一种改进的分水岭图像分割算法

A improved watershed image segmentation algorithm

吴雷磊 王卫星

分水岭算法在医学图像分割中有着广泛的应用。针对传统分水岭分割算法对噪声敏感和严重的过分割问题.本文提出了一种基于数学形态学的改进的分水岭图像分割算法。通过前期的预处理和汇水盆地的选取,有效地抑制了过分割现象。实验表明,该算法能够对血细胞图像进行快速、准确的分割,边缘定位精确,并且能够较好的克服噪声对图像的影响。[著者文摘]

The watershed algorithm is widely used in medical image segmentation. In allusion to resolving the problems of noise sensitivity and over-segmentation existing in traditional watershed algorithm, this paper proposes an improved watershed segmentation algorithm based on morphological mathematics. Through the pretreatment in prophase and the catchment basin chosen, the phenomena of over-segmentation can be restrained. Experimental results show that the proposed algorithm can segment images of blood corpuscle quickly and accurately, and exactly locate edges. Furthermore, the influence of noisy can be averted by this way.[著者文摘]

基于分水岭和模糊C均值聚类的图像分割方法

Image segmentation based on watershed and fuzzy C-means clustering

杨洪薇 肖志涛 翁秀梅

针对分水岭算法对微弱边缘和噪声非常敏感、容易导致过分割现象的问题,提出综合运用分水岭算法和基于区域的模糊C均值聚类的图像分割方法.与单独使用分水岭方法相比,该方法不仅利用区域的灰度信息,而且考虑了区域间的空间信息.实验结果表明,本方法能有效地对图像进行分割,克服了分水岭算法的过分割问题.[著者文摘]

Watershed algorithm often causes oversegmentation because of its high sensitivity to the weak edge and the noise. To overcome its limitation, watershed algorithm was combined with region-based fuzzy C-means clustering for image segmentation. Compared with watershed algorithm, not only the grayscale information but also each region's spatial information is considered in this method. Experimental results show that this method can efficiently overcome the oversegmentation problem.[著者文摘]

基于分水岭变换的彩色图像分割

龚天旭 彭嘉雄

为了克服传统分水岭算法固有的过度分割问题,采用了标记-分水岭变换,提出了一种新的标记提取方法。通过计算图像中每个小区域(5×5)的均匀性而得到一幅与原图同样大小的表征原图区域均匀性的均匀性图,取均匀性图中的低谷作为标记对均匀性图进行分水岭变换就得到最终的分割结果。

一种改进的分水岭人脑MR图像分割方法

AN IMPROVED WATERSHED TRANSFORM FOR BRAIN MR IMAGE SEGMENTATION

李荣艳[1] 熊文生[2] 曹佃国[3]

针对传统分水岭算法分割图像后存在的细节不准确问题,提出了一种改进的分水岭算法.此算法将传统分水岭算法和概率相结合,通过有序队列来实现边界的计算,从而得到分水岭.实验证明,这种算法得到的结果更加准确,对人脑MR图像病灶区的分割非常重要.[著者文摘]

As to the problem of inaccurate detail in scheme segmentation, a new method of improved watershed algorithm is proposed. This method combines traditional watershed algorithm and probability, Through ordered queue, boundary is calculated and watershed is obtained. The experiment proves that the precision of this method is very high and very useful to the segmentation of brain MR scheme.[著者文摘]

基于分水岭变换和蚁群聚类的图像分割

Image segmentation method based on watersheds and ant colony clustering

杨卫莉 郭雷 赵天云 肖谷初

针对传统分水岭分割算法对噪声敏感和易于产生过分割问题,提出一种新的基于分水岭和蚁群智能聚类的图像分割方法(CWAC,Combining watersheds and ant colony clustering)。CWAC方法首先用分水岭变换对图像做初分割,然后用蚁群方法在区域之间进行聚类合并,获得最终的分割结果。CWAC不但成功地解决了分水岭存在的过分割问题,还大大提高了蚁群聚类算法的搜索效率;本文利用分水岭变换后的灰度信息和空间信息,定义了一种新的引导函数,可更准确有效引导蚁群聚类。实验结果表明CWAC可以快速准确地分割出目标,是一种有效的图像分割方法。[著者文摘]

Aimed at resolving the problems of sensitivity to noise and over-segmentation existing in traditional watershed algorithm, a new image segmentation method -CWAC is presented. First, an image is separated into a large number of small partitions by watershed algorithm and the characteristic parameters are calculated. Second, CWAC method merges different regions of homogeneity with ant colony clustering algorithm to gain result of image segmentation. CAWC algorithm can successfully solve the over-segmentation problem and at the same time it can reduce the computational times of ant colony clustering. In order to be more accurate and efficient at clustering ant colony, a new visibility based on intensity distribution and spatial information is defined. Experimental results show that CWAC can segment objective quickly and accurately and it is a practicable method for the image segmentation .[著者文摘]

基于分水岭-隐马尔可夫模型联合的语义视频对象提取技术

SEMANTIC VIDEO OBJECT EXTRACTION BY HYBRID WATERSHED-HIDDEN MARKOV RANDOM FIELD MODEL

杨树堂 汤志平

针对3C无线网络的增值服务业务,提出一种语义对象基于分水岭算法的视频帧内的分割,及基于隐马尔可夫模型的视频帧间跟踪提取技术。其主要的特点是首先采用基于标识集的分水岭算法来进行初始帧内语义视频对象的标定和分割处理,随后再进行二值化掩膜处理,最后借助隐马尔可夫测量场模型,将后续帧中视频对象的跟踪处理演化为跟踪区域与非跟踪区域的二值离散化标定问题。实验结果证明,该算法能很好地实现视频帧序列中语义视频对象的连续提取。[著者文摘]

In order to deal with the increment service of 3G wireless network, a semantic video object extracting technique based on hybrid watershed-hidden Markov random field model is put forward. Its main characteristic is that the semantic video object in the initial frame is identified and segmented by improved watershed algorithm based on identifier sets, and then the SVO is masked by two valuse 0 and 1. Finally the video object is tracked in the next frames by using the hidden Markov Random field model. The tracking process can be regarded as discrete labeling problem. The results of the experiment show that the algorithm performs well in semantic video object extraction.[著者文摘]

基于分水岭变换的目标图像的分割与计数方法

A Segment and Count Method Based on Watershed Transformation

林小竹[1] 王彦敏[2] 杜天苍[1] 田瑞卿[2]

针对在图像分析中所获得的目标物体相互粘连的情况,利用分水岭变换的模拟浸水原理,提出了一种新的、有效的分水岭分割算法。算法只需考虑图片中像素的4连通和集水盆地的边缘情况即可,使得粘连物体得到了有效的切割和分离。统计各个所得盆地即可以得到实际物体的准确个数。该分割方法成功有效地解决了目标物体粘连而造成的不便和对后续处理的干扰等问题,同时把该算法用于对粘连物体的计数方面,使本来繁琐、复杂的图像物体计数变得十分简单、便捷。是一种切实可行的图像分割与计数方法。[著者文摘]

This paper presents an efficient watershed algorithm that is based on connected components. In this algorithm, the 4-conn and edge of the catchment basin is the only thing that needs to be considered, so the algorithm is low memory consuming. Furthermore, the algorithm can make the touched objects separate from each other efficiently. It can get the exact number of the target object from counting the number of the catchment basin. It successfully solves the inconvenience brought by the touched objects and carves out an efficient way for the successive work. At same time, it is applied to count the number of objects and make the counting number of objects very easy and convenient. So, it is an efficient way to separate and account touched objects.[著者文摘]

奥运会是行情分水岭吗?

市场上关于奥运会有可能成为股市转折点的说法由来已久,进入2008年,随着奥运会日益临近,这一话题更是日益升温。“奥运不是中国股市的分水岭。”北京大学金融与证券研究中心主任曹凤岐旗帜鲜明地表达了自己的看法。他认为,奥运肯定会对中国经济产生推动作用,但并不是奥运之前股市好、奥运之后就不行了。实际上,奥运带给了中国很多更好的投资机会,奥运以后还会有更多的投资机会。“有人说在奥运之前赶快把股票都出掉,实际上肯定吃大亏,千万别出掉。”[第一段]


Please Click the Link of Reference to Download Source Code

评论

2009年05月06日 15时
xiexie!

2009年05月06日 09时
很好啊

2009年05月04日 16时
thanks

2009年05月04日 13时
很好

2009年04月30日 06时
感谢

2009年04月18日 19时
很好,谢谢

2009年04月18日 12时
学习一下

2009年04月17日 13时
太好了

2009年04月17日 11时
不错呀,谢谢了

2009年04月09日 06时
好东西,继续努力

2009年04月05日 21时
hao

2009年04月05日 10时
谢谢

2009年04月04日 17时
谢谢了。。。。

2009年03月25日 22时
很好

2009年03月25日 10时
谢谢你了。。。。

2009年03月25日 09时
很好,看看

2009年03月24日 14时
很好的學習

2009年03月21日 03时
怎么下不了

2009年03月19日 13时
佩服~~

2009年03月16日 19时
不错,值得一看

2009年03月16日 11时
谢谢分享!

2009年03月15日 13时
谢谢

2009年03月09日 19时
非常好啊

2009年03月04日 19时
谢谢了

2009年03月03日 18时
谢谢。

2009年03月03日 16时
好东西

2009年03月02日 02时
thxthx

2009年03月01日 12时
好好学习

2009年02月26日 03时
so good

2009年02月25日 04时
嘿嘿,很有用啊.

2009年02月24日 18时
抽空学习一下

2009年02月24日 01时
下不来

2009年02月23日 22时
非常感谢

2009年02月20日 20时
太好了

2009年02月19日 18时
不会使用呀

2009年02月16日 19时
学习一下WCF

2009年02月16日 12时
很好

2009年02月14日 15时
不错啊

2009年02月06日 21时
谢谢

京ICP备08011023号