Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

for multiple components / labels you will have to make a binary mask for each single label as in:

for l in labels[1:]: # ignore background
    mask = labels[labels==l] # select pixels for label l
    cv2.moments(mask)