华南理工大学学报(自然科学版) ›› 2017, Vol. 45 ›› Issue (7): 84-89.doi: 10.3969/j.issn.1000-565X.2017.07.012

• 计算机科学与技术 • 上一篇    下一篇

基于游程的连通区域标记两次扫描快速算法

吕常魁 徐岩 罗冰心   

  1.  南京航空航天大学 机电学院,江苏 南京 210016
  • 收稿日期:2016-10-09 修回日期:2017-03-26 出版日期:2017-07-25 发布日期:2017-06-01
  • 通信作者: 吕常魁( 1971-) ,男,博士,副教授,主要从事机器视觉及其工业检测研究. E-mail:maillck@nuaa.edu.cn
  • 作者简介:吕常魁( 1971-) ,男,博士,副教授,主要从事机器视觉及其工业检测研究.
  • 基金资助:
    国家自然科学基金资助项目( 51375238)

A Fast Run-Based Two-Pass Algorithm for Connected Components Labeling

LYU Chang-kui XU Yan LUO Bing-xin   

  1. College of Mechanical and Electrical Engineering,Nanjing University of Aeronautics and Astronautics,Nanjing 210016,Jiangsu,China
  • Received:2016-10-09 Revised:2017-03-26 Online:2017-07-25 Published:2017-06-01
  • Contact: 吕常魁( 1971-) ,男,博士,副教授,主要从事机器视觉及其工业检测研究. E-mail:maillck@nuaa.edu.cn
  • About author:吕常魁( 1971-) ,男,博士,副教授,主要从事机器视觉及其工业检测研究.
  • Supported by:
    Supported by the National Natural Science Foundation of China( 51375238)

摘要: 为提高二值图像连通区域标记( CCL) 的计算效率,提出快速游程标记( FRL) 算法,对基于游程的两次扫描算法中的传统游程连通检测算法进行了优化; 然后介绍了基于
FRL 与并查集的整体算法; 最后对 FRL 的计算效率进行了实验验证,并将整体算法与RTS 与 SAUF 两种典型的两次扫描 CCL 算法进行了比对分析. 结果表明: FRL 算法省去了行间游程不必要的后续比对,使得比对形式接近于链式,大幅度提高了游程标记的计算效率,时间复杂度由传统 RL 算法的 O( mn) 降为 O( m + n -1) ,执行时间降为与并查集运算环节同一量级; 整体算法的性能明显优于 RTS 算法,总体上略优于 SAUF 算法.

关键词: 连通区域标记, 两次扫描算法, 连通检测算法, 游程标记, 并查集

Abstract: In order to improve the calculation efficiency of connected component labeling ( CCL) algorithms of bi- nary images,firstly,an algorithm named FRL,which optimizes the conventional overlapping runs detection algo- rithm for run-based two-pass labeling algorithms,is proposed.Secondly,a general algorithm on the basis of FRL and union find is introduced.Then,some experiments are carried out to verify the computational efficiency of FRL.Finally,a comparative analysis is made between the general algorithm and other two typical two-pass CCL algo- rithms ( namely RTS and SAUF) . The results demonstrate that,as FRL saves unnecessary subsequent connectivity checks on runs between adjacent rows,the connectivity detection process is optimized into a chain-like mode,the calculation efficiency of run length labeling process improves greatly,the time complexity reduces from conventional O ( mn) to O ( m + n -1) ,and the execution time decreases to the same level as the union find algorithm mod- ule.Moreover,it is found that the proposed general algorithm greatly outperforms RTS but is slightly better than SAUF in general.

Key words: connected component labeling, two-pass algorithm, connectivity detection algorithm, run length labe- ling, union find

中图分类号: