I am looking at speeding up an alpha matting algorithm. To do this I need to cut a mat of this image:
into the smallest possible sections, where each section contains all three of the possible colors. (the alpha matting algorithm requires all three to compute the matte).
It will not always be the same image, how can i automatically split a Mat into submats based on all three colors being present?
thank you.