title: OpenCV Python remap data type error
body: <p>I am attempting to remap an image with openCv, using cv2 and numpy but I am having some issues. The error I receive is:</p>
  
  <blockquote>
    <p>OpenCV Error: Assertion failed (((map1.type() == CV_32FC2 || map1.type() == CV_16SC2) &amp;&amp; map2.empty()) || (map1.type() == CV_32FC1 &amp;&amp; map2.type() == CV_32FC1)) in remap, file /tmp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/imgproc/src/imgwarp.cpp, line 5043</p>
  </blockquote>
  
  <p>But both maps are float32 type - so I don't quite understand the error. I am running the following code in a function: </p>
  
  <pre><code>rows, cols, channels = img.shape
  
  map_x = np.zeros( (rows,cols,channels), np.float32 )
  map_y = np.zeros( (rows,cols,channels), np.float32 )
  
  for i in xrange( rows ):
      for j in xrange( cols ):#
  
          p = [ i, j ]
  
          x = np.array( [ p[0], p[1], 1, p[0]*p[1]] )
          #Compute pixel transform
          trans = np.round( x.dot( self.w ) )
  
          map_x[i,j] = trans[0]
          map_y[i,j] = trans[1] 
  
  
  outimg = cv2.remap( img, map1, map2, cv2.INTER_CUBIC )
  </code></pre>
  
  <p>Thanks in advance</p>