I'm working with the library MaskRCNN and i want to get the area of each mask. All the masks are an array (W x H) with values False or True. All the trues represent a mask and all the falses a background.
#mask 0
r['masks'][:,:,0]
#output-->
array([[False, False, False, ..., False, False, False],
[False, False, False, ..., False, False, False],
[False, False, False, ..., False, False, False],
...,
[False, False, False, ..., False, False, False],
[False, False, False, ..., False, False, False],
[False, False, False, ..., False, False, False]])
How can i iterate over all and sum all the true occurrences, both in columns and rows?
This i suppose give me the area in pixels of the mask, which i can interpolate real area.