How to perform a union operation in java opencv

后端 未结 2 679
面向向阳花
面向向阳花 2021-01-26 07:42

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         


        
2条回答
  •  走了就别回头了
    2021-01-26 08:01

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

提交回复
热议问题