So, I'm currently developing some CNN models (using Keras) to classify images. As a first step, I have to mask each one of the images before converting it to a tensor.
I was planning on adding a fixed mask, using cv2.fillConvexPoly
, however, I've noticed that it wouldn't work, because a fixed mask would not apply to all the images, as some of them are, let's say, "out of the mask's safe zone".
I have also tried using cv2.threshold
techniques, but in most cases, the mask fills my target.
And as I'm working with millions of images, I cannot simply apply a mask manually.
Is there any other way of doing this dynamically using OpenCV? If not, is that any other library i could use?