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.