我正在使用PyOpenCV.如何将cv2映像(numpy)转换为二进制字符串,以便在没有临时文件的情况下写入MySQL数据库imwrite?
我用谷歌搜索但没有发现......
我正在尝试imencode,但它不起作用.
capture = cv2.VideoCapture(url.path)
capture.set(cv2.cv.CV_CAP_PROP_POS_MSEC, float(url.query))
self.wfile.write(cv2.imencode('png', capture.read()))
Run Code Online (Sandbox Code Playgroud)
错误:
File "server.py", line 16, in do_GET
self.wfile.write(cv2.imencode('png', capture.read()))
TypeError: img is not a numerical tuple
Run Code Online (Sandbox Code Playgroud)
帮助别人!