Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Split a Mat into parts, based on each containing three colors?

I am looking at speeding up an alpha matting algorithm. To do this I need to cut a mat of this image:

image description

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.

Split a Mat into parts, based on each containing three colors?

I am looking at speeding up an alpha matting algorithm. To do this I need to cut a mat of this image:

image description

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 chop up a Mat into submats based on all three colors being present?

thank you. you.

Split a Mat into parts, based on each containing three colors?

I am looking at speeding up an alpha matting algorithm. To do this I need to cut a mat of this image:

image description

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 chop up a Mat into submats based on all three colors being present?

So what I have now is:

image description

But the matte algorithm fails where there is only black and gray, or only white and gray. I need every color inside every section. I guess something like this would work for this image:

image description

But every image will be different, so I will need to work it out based on color.

thank you.