title: Python3 OpenCV imshow() bytes string
body: <p>I've got a bytestring from my camera and I'd like to show the frame with OpenCV WITHOUT saving it (saving time). I've checked this question: <a href="https://stackoverflow.com/questions/17170752/python-opencv-load-image-from-byte-string">Python OpenCV load image from byte string</a> but I get an error <code>failed to import cv from cv2</code>.    </p>
  
  <p>print(frame): <code>b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\...</code>    </p>
  
  <p>My code (in a loop ofc):    </p>
  
  <pre><code>frame = # need to convert bytestring for imshow()
  cv2.imshow('image', frame)
  cv2.waitKey(1)
  </code></pre>
  
  <p>Also, the code worked if I just saved it as a file, then loaded it with cv2.imread(..), but the best would be to skip filesave and load.</p>
  
  <p>So this doesn't work anymore, as cv was removed from OpenCV3.</p>
  
  <pre><code>nparr = np.fromstring(frame, np.uint8)
  img_np = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
  
  img_ipl = cv.CreateImageHeader((img_np.shape[1], img_np.shape[0]), cv.IPL_DEPTH_8U, 3)
  cv.SetData(img_ipl, img_np.tostring(), img_np.dtype.itemsize * 3 * img_np.shape[1])
  
  cv2.imshow('image', img_ipl)
  cv2.waitKey(1)
  </code></pre>
  
  <p>How can then pass the bytestring without creating a temporary file?</p>