Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

assuming, those trimaps contain a single channel of [0,1,2] values, it's no wonder, that it looks "all black".

you could try to increase the contrast, e.g. like:

imshow("trimap", trimap*80);

assuming, those trimaps contain a single channel of [0,1,2] values, it's no wonder, that it looks "all black".

to visualize them, you could try to increase the contrast, e.g. like:

imshow("trimap", trimap*80);

to mask out the backgound, using those trimaps, you would build a mask, using the resp. label (let's assume, 0 for bg):

Mat mask = (trimap==0);
image.setTo(Scalar::all(0), mask); // paint black, where the mask is "on".