Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

1.

Mat = Scalar(255,255,255) - Mat;

2.

subtract(Scalar(255,255,255), Mat, Mat);

1.

Mat mat = Scalar(255,255,255) - Mat;
mat;

2.

subtract(Scalar(255,255,255), Mat, Mat);
mat, mat);

you need a 3-channel value to subtract from, else it does something like 0 - value, which gets saturated to 0, so:

1.

mat = Scalar(255,255,255) - mat;

2.

subtract(Scalar(255,255,255), mat, mat);