1 | initial version |
you can use the binary mask image from inRange() with bitwise_and
Mat combined = new Mat();
Core.bitwise_and( bgr, bgr, combined, mask );
2 | No.2 Revision |
you can use the binary mask image from inRange() with bitwise_and
Mat combined = new Mat();
Core.bitwise_and( bgr, bgr, combined, mask );
// or:
Mat combined = Mat.zeros(bgr.size(), bgr.type());
bgr.copyTo(combined, mask);
3 | No.3 Revision |
you can use the binary mask image from inRange() with bitwise_and
Mat combined = new Mat();
Mat.zeros(bgr.size(), bgr.type());
Core.bitwise_and( bgr, bgr, combined, mask );
// or:
Mat combined = Mat.zeros(bgr.size(), bgr.type());
bgr.copyTo(combined, mask);