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