I need to write an equivalent Java OpenCV
code as this C++
code
Mat1b mask1, mask2;
inRange(hsv, Scalar(0, 70, 50), Scalar(10, 255, 255
I think what you're mistaking is that you are trying to compare two Mat
object refrences and not the values beneath them. I'm not super familiar with openCV but my guess is you are trying to combine the values under them, so you could use the method https://docs.opencv.org/java/2.4.2/org/opencv/core/Mat.html#nativeObj. which that line in question would be re-written as:
Mat hsvThres = new Mat(mask1.nativeObj | mask2.nativeObj);