Ask Your Question

Revision history [back]

click to hide/show revision 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 );

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);

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);