title: Mat subtraction with OpenCV in Java
body: <p>I'm trying to convert some opencv code from C++ to Java, but I'm stuck at this code:</p>
  
  <pre><code>Mat matXyz; // some Mat
  Mat result; // some other Mat
  // ... set above mats to some values ...
  result = Mat::ones(matXyz.size(), CV_32F) - result;
  </code></pre>
  
  <p>First, I don't really understand what the last line even does. 
  Second, I don't know how to transfer this line to Java (OpenCV 2.4.6), as there are no overloaded operators like in C++, and I could not find any comparable method in the Java class (see <a href="http://docs.opencv.org/java/org/opencv/core/Mat.html" rel="noreferrer">OpenCV Javadoc</a>). </p>
  
  <p>What is the best way to transfer this into Java?</p>