title: Opencv Python display raw image
body: <p>I can't figure out how to display a raw image which contains 640x480 pixel information, each pixel 8 bit. (Gray image)</p>
  <p>I need to go from an np array to Mat format to be able to display the image.</p>
  <pre><code>#!/usr/bin/python
  import numpy as np
  import cv2
  import sys
  # Load image as string from file/database    
  fd = open('flight0000.raw')
  img_str = fd.read()
  fd.close()
  
  img_array = np.asarray(bytearray(img_str), dtype=np.uint8)
  
  img = ... Conversion to Mat graycolor
  
  cv2.imshow('rawgrayimage', img)
  cv2.waitKey(0)
  </code></pre>
  <p>It so confusing with the cv, cv2. I have been trying for a while now, but I can't find the solution.</p>