How can we use OpenCV to give the iris (white part) one color and the pupil another color?

35 Views Asked by At

I'm working on a segmentation problem where I need to separate the iris and pupil regions accurately. However, the datasets I have only provide binary masks, like the image you see. So, I attempted to convert these masks into multi-class masks. Is there a method to color the overlapping part of the iris(white area of the detected recngle) and pupil separately? (https://i.stack.imgur.com/sQeO7.jpg)

At first, I used the Canny edge detector to find edges and then located the contours in the image. I sorted these contours by size, with the largest one representing the iris and the smallest one representing the pupil. But, is there a way to identify the overlap of these contours and apply colors based on that intersection?

0

There are 0 best solutions below