connected component labeling in python
How to implement connected component labeling in python with open cv? This is an image example: I need connected component labeling to separate objects on a black and white image. The OpenCV 3.0 docs for connectedComponents() don't mention Python but it actually is implemented. See for e.g. this SO question . On OpenCV 3.4.0 and above, the docs do include the Python signatures, as can be seen on the current master docs . The function call is simple: retval, labels = cv2.connectedComponents(img) and you can specify a parameter connectivity to check for 4- or 8-way (default) connectivity. The