Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Create trimap from approximated mask

I would like to create a trimap to be used for matting, given an approximated (black and white) mask in which every pixel within 10 pixels of the edge would be gray.

Of course, the naive solution would be to go through the image, find all pixels that have an opposite color neighbor and paint a gray circle around it (mark every pixel within 10 pixels of each such pixel as gray).

I'm wondering if there is an easier/faster way to code it.

Create trimap from approximated mask

I would like to create a trimap to be used for matting, given an approximated (black and white) mask in which every pixel within 10 pixels of the edge would be gray.

Of course, the naive solution would be to go through the image, find all pixels that have an opposite color neighbor and paint a gray circle around it (mark every pixel within 10 pixels of each such pixel as gray).

I'm wondering if there is an easier/faster way to code it.

What I mean is - given this: image description

Create this: image description

Create trimap from approximated mask

I would like to create a trimap to be used for matting, given an approximated (black and white) mask in which every pixel within 10 pixels of the edge would be gray.

Of course, the naive solution would be to go through the image, find all pixels that have an opposite color neighbor and paint a gray circle around it (mark every pixel within 10 pixels of each such pixel as gray).

I'm wondering if there is an easier/faster way to code it.

What I mean is - given this: this:

image description

Create this:

image description