title: How do I use OpenCV's remap function?
body: <p>Here's the simplest possible test case for remap():</p>
  
  <pre><code>import cv2
  import numpy as np
  inimg = np.arange(2*2).reshape(2,2).astype(np.float32)
  inmap = np.array([[0,0],[0,1],[1,0],[1,1]]).astype(np.float32)
  outmap = np.array([[10,10],[10,20],[20,10],[20,20]]).astype(np.float32)
  outimg = cv2.remap(inimg,inmap,outmap,cv2.INTER_LINEAR)
  print "inimg:",inimg
  print "inmap:",inmap
  print "outmap:",outmap
  print "outimg:", outimg
  </code></pre>
  
  <p>and here's the output:</p>
  
  <pre><code>inimg: [[ 0.  1.]
   [ 2.  3.]]
  inmap: [[ 0.  0.]
   [ 0.  1.]
   [ 1.  0.]
   [ 1.  1.]]
  outmap: [[ 10.  10.]
   [ 10.  20.]
   [ 20.  10.]
   [ 20.  20.]]
  outimg: [[ 0.  0.]
   [ 0.  0.]
   [ 0.  0.]
   [ 0.  0.]]
  </code></pre>
  
  <p>As you can see, outimg produces 0,0, and it's not even in the correct shape.  I expect a 20x20 or 10x10 image with interpolated values from range 0 to 3.  </p>
  
  <p>I've read all the documentation. It and everyone on SO states you input an array (a map) of starting points, a map of ending points, and then remap() will put all the values in img into their new positions, interpolating any empty space.  I'm doing that, but it just doesn't work.  Why?  Most examples are for C++.  Is it broken in python?</p>