title: Reading an image to OpenCV (Numpy) by an input uint8 array
body: <p>I am trying to develop an application which upload an image by using some Javascript codes. The Javascript code return me an array with the size equal to its size. so if I have a 4k size jpg image, it returns to me (approximate) 4,000 bytes of image data with the type of unit8. It is a python list like below.</p>
  <pre><code>[137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 50, 0, 0, 0, 50, 8, 6, 0, 0, 0, 30, 63, 136, 177, 0, 0, 0, 1, 115, 82, 71, 66, 1, 217, 201, 44, 127, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 11,
  19, 0, 0, 11, 19, 1, 0, 154, 156, 24, 0, 0, 12, 76, 73, 68, 65, 84, 120, 156, 205, 90, 9, 116, 84, 85, 18, 125, 85, 191, 155, 69, 136, 6, 81, 143, 204, 184, 224, 130, 251, 58, 234, 168, 227, 56, 42, 46, 99, 0, 145
  , 221, 153, 1, 68, 22, 9, 4, 18, 72, 128, 132, 64, 22, 146, 16, 18, 8, 4, 8, 73, 200, 0, 178, 4, 68, 86, 89, 195, 190, 139, 130, 65, 16, 5, 113, 1, 4, 21, 20, 16, 81, 32, 64, 72, 250, 85, 205, 253, 29, 228, 140, 1
  03, 28, 108, 9, 33, 212, 57, 117, 222, 79, 247, 239, 247, 235, 190, 170, 186, 85, 245, 193, 152, 75, 64, 236, 60, 67, 190, 5, 166, 186, 46, 50, 84, 174, 141, 36, 147, 59, 74, 180, 39, 167, 180, 11, 229, 74, 123, 2
  06, 181, 221, 157, 116, 219, 143, 250, 105, 154, 19, 103, 211, 169, 124, 155, 159, 235, 185, 83, 13, 233, 108, 122, 192, 206, 50, 233, 50, 139, 18, 101, 9, 215, 214, 105...]
  </code></pre>
  <p>Now I have above byte array, I would like to know how to read above array in OpenCV or by using Numpy?</p>
  <p>I have written some codes by <code>imdecode</code> and <code>imread</code> but none of them work properly.</p>
  <pre><code>import cv2
  img = cv2.imdecode(np.asarray(image_array), cv2.IMREAD_UNCHANGED)
  </code></pre>
  <p>The above codes always return me null images. Is this possible to read an image in OpenCV by using above array?</p>