2014,50(23)
1 引言
二值图像连通区域标记是指对图像中不同连通区
域中的像素设置唯一的标号,是计算机视觉、模式识别
和图像处理等领域中众多算法的基础
[1-4]
。例如,在对医
学、遥感、视频等图像进行处理时,通过连通域标记来确
定物体的边缘,以对感兴趣的区域(目标)进行标记和提
取;在电气行业的真空断路器的开断特性研究中,其基
本方法是通过对图像连通域的查找来确定电弧图像中
电弧面积和直径的变化规律,进而确定电弧的运动机
理
[5-6]
。这些算法通常需要处理大量的图像,连通域标记
算法的效率是一个关键问题。
目前,存在着多种连通区域标记算法,从处理的对
高效的一遍扫描式连通区域标记算法
冯海文
1,2
,牛连强
1
,刘晓明
2
FENG Hai wen
1,2
, NIU Lianqiang
1
, LIU Xiaomin g
2
1.沈阳工业大学 软件学院,沈阳 11 0023
2.沈阳工业大学 电气工程学院,沈阳 110023
1.School of Softwa re, Shenyang University of Technology, Shenyang 110023, China
2.School of Electrical Engineering, Shenyang University of Technolo gy, Shenyang 110023, China
FENG Haiwen, NIU Lianqiang, LIU Xiaoming. Efficient one-scan algorithm for labeling connected c omponent.
Computer Engineering and Applicatio ns, 2014, 50(23):31-35.
Abstract:How to label conne cted com ponents of a binary image is a basic problem in image processing field. To improve
efficiency, a fast one-scan algorithm to label connected components is presented in this paper on the base o f th e multiple-
scans algorithm proposed by Suzuki et al. The algorithm runs a forward scan to the object image o nly once. The node with
the minim um label in the mask of the object pixel is calculated. The node with smaller label is searched in the connected
component by an iterative process, and the connected branch includin g the note to be updated i s linked to it. This tec h-
nique can guarantee no loss to the equivalent information. At the s ame time, the provisional labels in iterative search path
are updated by the minimum label in order to decrea se the depth of the branch. The final labels of all nodes are obtained
by scanning the connected table. Dynamic data structure and recursive procedure are not ne eded in this algorithm, and only
less memory is required. Exp eriments and analys is show that the algorithm is about 2 times faster than the original one,
and is also faster than some run algorithms proposed recently.
Key words:connected component; labeling algorithm; one-scan; label; binary image; label co nnected table
摘 要:二值图像的连通区域标记算法是图像处理的一个基本问题。为了提高算法的效率,以 Suzuki 等人提出的多
遍扫描算法为基础,提出了一种快速的一遍扫描连通域标记算法。算法通过对图像做一次正向扫描,先计算出每个
当前像素所在邻域内的最小标号,再利用一个递推过程,查找该连通域中具有较小标号的结点,将被更新结点所在
连通分支连接到该结点,以保证等价信息不损失。同时,用最小标号更新递推查找路径上结点的临时标号,以减小
分支的深度。通过对连接表的更新使每个结点获得最终标号。算法不需要动态数据结构和递归过程的支持,需要
的存储空间较小,算法比原算法速度提高了近 2 倍,也快于近期提出的一些基于游程的算法。
关键词:连通域;标记算法;一遍扫描;标号;二值图像;标记连接表
文献标志码:A 中图分类号:TP391.41 doi:10.3778/j.issn.1002-8331.1407-0409
基金项目:国家自然科学基金(No.51377106)。
作者简介:冯海文(1977—),男,博士生,讲师,主要研究方向为图形图像算法、计算机仿真;牛连强(1965—),男,教授,主要研究
方向为图形图像算法、计算机仿真;刘晓明(1 968—),女,博士,教授,主要研究方向为现代电器理论设计、高电压及绝
缘技术研究。E-mail:fhw19770704@sina.com
收稿日期:2014-07-28 修回日期:2014-10-21 文章编号:1002-8331(2014)23-0031-05
C omputer Engineering and Applications 计算机工程与应用
31