title: Efficient matrix copying in OpenCV
body: <p>I have no idea for how to implement matrix implementation efficiently in OpenCV.
  I have binary <code>Mat nz(150,600)</code> with 0 and 1 elements.
  I have Mat <code>mk(150,600)</code> with double values.
  I like to implement as in Matlab as</p>
  
  <pre><code>sk = mk(nz);
  </code></pre>
  
  <p>That command copy mk to sk only for those element of mk element at the location where nz has 1. Then make sk into a row matrix.
  How can I implement it in OpenCV efficiently for speed and memory?</p>