1 | initial version |
normalize(src, dst, 0, 255, NORM_MINMAX);
2 | No.2 Revision |
// make a mask, where "wanted" pixels are 255
Mat mask;
inRange(img, Scalar::all(50), Scalar::all(100), mask); // ::all in case of multiple chans
// to [0,255], restricted to mask "on" (else set to 0)
normalize(src, dst, 0, 255, NORM_MINMAX);
NORM_MINMAX, -1, mask);
3 | No.3 Revision |
// make a mask, where "wanted" pixels are 255
Mat mask;
inRange(img, inRange(src, Scalar::all(50), Scalar::all(100), mask); // ::all in case of multiple chans
// to [0,255], restricted to mask "on" (else set to 0)
// Mat dst;
normalize(src, dst, 0, 255, NORM_MINMAX, -1, mask);