I have an image and its corresponding mask for the cob as numpy arrays:
The image numpy array has shape (332, 107, 3).
The mask is Boolean (consists of True/False) and has this shape as binary (332, 107).
[[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 get the color pixels of the cob (all pixels in the color image where the mask is)?



img[mask[..., None]]?cob = img * maskbecauseFalseevaluates to zero.