title: opencv android java matrix submatrix (ROI Region of Interest)
body: <p>I've <code>mRgba Matrix and a Rect r</code> (something recognized in the frame)</p>
  
  <p>I want a sub-matrix of this part of the frame which is defined by the <code>Rect r.</code></p>
  
  <p>when I use it like this:</p>
  
  <p><code>sub = mRgba.submat(r);</code></p>
  
  <p>I get the right sub-matrix, but I've a problem with the next steps, I want to change this part of the frame and then copy it back to the original.</p>
  
  <p><em>For example:</em></p>
  
  <pre><code> Imgproc.cvtColor(sub, sub, Imgproc.COLOR_RGBA2GRAY, 1); //make it gray
   Imgproc.cvtColor(sub, sub, Imgproc.COLOR_GRAY2RGBA, 4); //change to rgb
  </code></pre>
  
  <p>How can I copy this changed sub-matrix back to the original.
  or how can I get/create a Mask same size as mRgba with all zeros except the Rect r part?</p>