title: OpenCV resize() result is wrong?
body: <p>Sample program that upscales 2x2 matrix to 5x5 using bilinear interpolation.
  Result that OpenCV produces has artifacts at the borders for such simple case. </p>
  
  <pre><code>gy, gx = np.mgrid[0:2, 0:2]
  gx = np.float32(gx)
  print(gx)
  res = cv2.resize(gx,(5,5), fx=0, fy=0, interpolation=cv2.INTER_LINEAR)
  print(res)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>[[ 0.  1.]
   [ 0.  1.]]
  
  [[ 0.          0.1         0.5         0.89999998  1.        ]
   [ 0.          0.1         0.5         0.89999998  1.        ]
   [ 0.          0.1         0.5         0.89999998  1.        ]
   [ 0.          0.1         0.5         0.89999998  1.        ]
   [ 0.          0.1         0.5         0.89999998  1.        ]]
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>  [[0 0.25 0.5 0.75 1
      0 0.25 0.5 0.75 1
      0 0.25 0.5 0.75 1
      0 0.25 0.5 0.75 1
      0 0.25 0.5 0.75 1]]
  </code></pre>
  
  <p>What is the problem?</p>