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);
2 | No.2 Revision |
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".