1 | initial version |
1.
Mat = Scalar(255,255,255) - Mat;
2.
subtract(Scalar(255,255,255), Mat, Mat);
2 | No.2 Revision |
1.
Mat mat = Scalar(255,255,255) - Mat;
mat;
2.
subtract(Scalar(255,255,255), Mat, Mat);
mat, mat);
3 | No.3 Revision |
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);