title: How to resize without interpolation (zero-padding) in OpenCV?
body: <p>Is there an efficient way to resize an image in OpenCV without using any interpolation? Instead of the conventional "resize" I would like my image to remap the pixels into a larger image but pad everything else with 0.</p>
  
  <p>e.g. to scale up img1 below 2x to img2:</p>
  
  <pre><code>img1 = [ 1, 2, 3,
           4, 5, 6,
           7, 8, 9 ]
  
  cv::resize(img1, img2, cv::Size(6, 6));
  
  img2 = [ 1, 0, 2, 0, 3, 0,
           0, 0, 0, 0, 0, 0,
           4, 0, 5, 0, 6, 0,
           0, 0, 0, 0, 0, 0,
           7, 0, 8, 0, 9, 0,
           0, 0, 0, 0, 0, 0 ]
  </code></pre>
  
  <p>I know the obvious way is to just use a for loop, but I'm wondering if there is a more efficient way using an OpenCV call?</p>