How to break a binary image mask into multiple masks?

I have image with binary mask. I want to break the binary mask into many individual masks of same dimension, but each mask should contain only one segmentation mask. Is there a way to do it in python, or using libraries like pillow and open cv.

Topic image image-preprocessing image-segmentation

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.