I want moments for the connected component having the greatest area, but I can’t see an elegant way to locate said component given label numbering seems to be random 32 bit integers. Any suggestions?
opencv 4.9.0
I want moments for the connected component having the greatest area, but I can’t see an elegant way to locate said component given label numbering seems to be random 32 bit integers. Any suggestions?
opencv 4.9.0
I’m suprised I would have expected it to be the lowest indexed pixel in the blob.
If you need a structure similar to the CPU version I would use NPP, otherwise you have to write your own routine to compress the labels and extract the blob info. See NPP CompressedMarkerLabelsUFInfo for details.
Notes regarding NPP:
Thank you for the response.
That appears to be the background, which in my use case is indeed the largest area, but of no interest.
I’ll look at NPP: It would be really sweet if connectedComponents could be made to produce sequential labels starting at 0…