0

I am trying to implement the threshold method, made with OpenCV, posted here. It is written in C++, so I am trying to rewrite it for myself to Java, for Android Studio. In the code here there is a line:res=1.0-res;. "res" is Mat (OpenCV matrix, the same as: Mat mat = new Mat();). How can I subtract 1.0, which is 'double' format from res, which is 'Mat' format in Java?

Community
  • 1
  • 1
Dainius Šaltenis
  • 1,644
  • 16
  • 29

1 Answers1

0

Thank you, Miki, for helping to solve this. This is how it should be:

Core.subtract(new MatOfDouble(1.0), res, res);
Dainius Šaltenis
  • 1,644
  • 16
  • 29