title: tf.image.resize_bilinear vs cv2.resize
body: <p>The results from <code>tf.image.resize_bilinear</code> are quite different from <code>cv2.resize</code>.</p>
  
  <p>I found this a little bothersome. Set <code>align_corners=True</code> is not always reasonable because the four corners are not always supposed to be fixed in the corner. So is there anyway to make it a little more "symmetry"?</p>
  
  <p>Code to reproduce:</p>
  
  <pre><code>import tensorflow as tf
  import numpy as np
  import cv2
  np.set_printoptions(precision=3)
  resize_shape = (10, 10)
  
  a = np.ones((1, 2, 2, 1), dtype=np.float32)
  a[0, 0, 0, 0] = 5.0
  a[0, 1, 1, 0] = 5.0
  
  b = tf.constant(a, dtype=tf.float32)
  c = tf.image.resize_bilinear(b, resize_shape)
  
  with tf.Session() as sess:
      np_c = sess.run(c)
      print np_c[0, :, :, 0]
  
  print cv2.resize(a[0], resize_shape, interpolation=cv2.INTER_LINEAR)
  </code></pre>
  
  <p>Obtained results:</p>
  
  <pre><code># tf.image.resize_bilinear
  [[ 5.    4.2   3.4   2.6   1.8   1.    1.    1.    1.    1.  ]
   [ 4.2   3.72  3.24  2.76  2.28  1.8   1.8   1.8   1.8   1.8 ]
   [ 3.4   3.24  3.08  2.92  2.76  2.6   2.6   2.6   2.6   2.6 ]
   [ 2.6   2.76  2.92  3.08  3.24  3.4   3.4   3.4   3.4   3.4 ]
   [ 1.8   2.28  2.76  3.24  3.72  4.2   4.2   4.2   4.2   4.2 ]
   [ 1.    1.8   2.6   3.4   4.2   5.    5.    5.    5.    5.  ]
   [ 1.    1.8   2.6   3.4   4.2   5.    5.    5.    5.    5.  ]
   [ 1.    1.8   2.6   3.4   4.2   5.    5.    5.    5.    5.  ]
   [ 1.    1.8   2.6   3.4   4.2   5.    5.    5.    5.    5.  ]
   [ 1.    1.8   2.6   3.4   4.2   5.    5.    5.    5.    5.  ]]
  # cv2.resize
  [[ 5.    5.    5.    4.2   3.4   2.6   1.8   1.    1.    1.  ]
   [ 5.    5.    5.    4.2   3.4   2.6   1.8   1.    1.    1.  ]
   [ 5.    5.    5.    4.2   3.4   2.6   1.8   1.    1.    1.  ]
   [ 4.2   4.2   4.2   3.72  3.24  2.76  2.28  1.8   1.8   1.8 ]
   [ 3.4   3.4   3.4   3.24  3.08  2.92  2.76  2.6   2.6   2.6 ]
   [ 2.6   2.6   2.6   2.76  2.92  3.08  3.24  3.4   3.4   3.4 ]
   [ 1.8   1.8   1.8   2.28  2.76  3.24  3.72  4.2   4.2   4.2 ]
   [ 1.    1.    1.    1.8   2.6   3.4   4.2   5.    5.    5.  ]
   [ 1.    1.    1.    1.8   2.6   3.4   4.2   5.    5.    5.  ]
   [ 1.    1.    1.    1.8   2.6   3.4   4.2   5.    5.    5.  ]]
  </code></pre>
  
  <hr>
  
  <p><strong>EDITED</strong></p>
  
  <p>When setting <code>align_corners=True</code>, 4 corners of images and resized images are aligned <strong>but only 4 pixels</strong>. </p>
  
  <p>Considering resizing images, the 4 corners in the image should present the <strong>areas</strong> in 4 corners of the resized image (like <code>cv2.resize</code> does), instead of 4 points at the very corner.</p>
  
  <pre><code># tf.image.resize_bilinear(b, resize_shape, align_corners=True)
  [[ 5.    4.56  4.11  3.67  3.22  2.78  2.33  1.89  1.44  1.  ]
   [ 4.56  4.21  3.86  3.52  3.17  2.83  2.48  2.14  1.79  1.44]
   [ 4.11  3.86  3.62  3.37  3.12  2.88  2.63  2.38  2.14  1.89]
   [ 3.67  3.52  3.37  3.22  3.07  2.93  2.78  2.63  2.48  2.33]
   [ 3.22  3.17  3.12  3.07  3.02  2.98  2.93  2.88  2.83  2.78]
   [ 2.78  2.83  2.88  2.93  2.98  3.02  3.07  3.12  3.17  3.22]
   [ 2.33  2.48  2.63  2.78  2.93  3.07  3.22  3.37  3.52  3.67]
   [ 1.89  2.14  2.38  2.63  2.88  3.12  3.37  3.62  3.86  4.11]
   [ 1.44  1.79  2.14  2.48  2.83  3.17  3.52  3.86  4.21  4.56]
   [ 1.    1.44  1.89  2.33  2.78  3.22  3.67  4.11  4.56  5.  ]]
  </code></pre>