高级检索
赵永涛, 陈庆奎, 姬丽娜, 刘伯成. 基于CUDA的二值图像连通体标记算法[J]. 计算机辅助设计与图形学学报, 2017, 29(1): 72-78.
引用本文: 赵永涛, 陈庆奎, 姬丽娜, 刘伯成. 基于CUDA的二值图像连通体标记算法[J]. 计算机辅助设计与图形学学报, 2017, 29(1): 72-78.
Zhao Yongtao, Chen Qingkui, Ji Lina, Liu Bocheng. Algorithm for Connected Component Labeling of Binary Image Using CUDA[J]. Journal of Computer-Aided Design & Computer Graphics, 2017, 29(1): 72-78.
Citation: Zhao Yongtao, Chen Qingkui, Ji Lina, Liu Bocheng. Algorithm for Connected Component Labeling of Binary Image Using CUDA[J]. Journal of Computer-Aided Design & Computer Graphics, 2017, 29(1): 72-78.

基于CUDA的二值图像连通体标记算法

Algorithm for Connected Component Labeling of Binary Image Using CUDA

  • 摘要: 为了对二值图像中连通体的标记进行加速,提出一种基于CUDA的二值图像连通体标记算法.首先为每个非零元素赋予初始标号,再将标号修改为8邻域内最小标号来完成初始标记;然后根据结构元素匹配法找到标号矩阵中同一连通体有可能出现不同根标号的位置,使用原子操作对根标号进行合并,通过CPU与GPU的协同工作来判断合并程度并进行循环修改;最后对所有标号使用回溯法进行一次性修改,实现复杂形状的连通体标记.实验结果表明,该算法较已有的算法减少了全局内存的读写次数和处理线程数量,加快了处理速度.

     

    Abstract: To accelerate connected component labeling(CCL) in binary image, a CUDA based CCL algorithm is proposed. First, the algorithm assigns each none-zero element a unique initial label, and modifies the label to the smallest label around its 8-neighbor. Then, structure element matching method is used to find the positions that may contain different root labels within one connected component, different root labels are merged using atomic operation in CUDA. The merge operation would execute cyclically and the degree of merge is controlled by collaborative work of CPU and GPU. Finally, each label is modified to their root label by backtracking method, thus labeling the complex-shaped components correctly. The experimental results show that this algorithm reduces global memory access as well as the number of processing threads, meanwhile, accelerates the processing speed.

     

/

返回文章
返回