Connected Component Labeling

北城余情 提交于 2019-12-04 19:44:15

OpenCV is open source. You can look at the documentation and the source code.

You can choose 2 algorithms to perform connected component lablelling:

The default in OpenCV >= 3.2 (CCL_DEFAULT) uses Wu's algorithm for 4-connectivity, and Grana's algorithm for 8 connectivity.

In OpenCV 3.0.0 you use Wu's algorithm for both 4 and 8 connectivity, while in OpenCV >= 3.2 you can choose one of the 3 options, according to the fields connectivity and ccltype:

       \  connectivity   4    |   8
        \                     |
type     \                    |
                              |
CCL_DEFAULT              Wu   |  Grana
CCL_WU                   Wu   |  Wu
CCL_GRANA                Wu   |  Grana

You can read about connected component labeling algorithms in numerous sources

OpenCV implementation is here and contains this clue:

 //Based on "Two Strategies to Speed up Connected Components Algorithms", 
 //the SAUF (Scan array union find) variant
 //using decision trees
 //Kesheng Wu, et al

Article

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!