[Solved] OpenCV: How do I make a Mat colorized where the Mask is white


I tried switching out and frame in and using frame.copyTo(out, mask) instead of Core.bitwise_and(frame, mask, out)

It worked!!

Here is my final code:

// frame is input, out is output            
Scalar minValues = new Scalar(RFrom, GFrom, BFrom);
Scalar maxValues = new Scalar(RTo, GTo, BTo);
Mat mask = new Mat();
Core.inRange(frame, minValues, maxValues, mask);
frame.copyTo(out, mask);

1

solved OpenCV: How do I make a Mat colorized where the Mask is white