Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

connectedComponents returns a "labels" image, where each blob has its own id.

using that, Mat firstBlob = (labels==1); would paint your example image.