Decode image bytes data stream to JPEG
问题 I am struggling to successfully decode a JPEG image from bytes, back to JPEG again. I started from encoded frame from a MJPG bytes stream, which I want to decode in order to manipulate with OpenCV. I am a bit of a newbie at Python, numpy, opencv etc! I now have the frame JPG data in a text file as: b'\xf\xd8\xff\xdb\x00....etc etc for purposes of testing: code seems to fail when I try to Resize the numpy array to the original video stream resolution (640, 480) on line 14 (npFlat.reshape((640