How can we know the geometry of a blob detected by OpenCV
Instead of connected components you may also use blob detector mentioned here

It provides some information on the shape and geometry of blob

For geometric moments you will have to compute contours.

I am not sure what do you mean by connected components being a black box.