I\'m working with PyOpenCV. How to convert cv2 image (numpy) to binary string for writing to MySQL db without a temporary file and imwrite?
imwrite
I googled it
im = cv2.imread('/tmp/sourcepic.jpeg') res, im_png = cv2.imencode('.png', im) with open('/tmp/pic.png', 'wb') as f: f.write(im_png.tobytes())