相关疑难解决方法(0)

Python OpenCV将图像转换为字节串?

我正在使用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)

帮助别人!

python binary opencv image

29
推荐指数
5
解决办法
6万
查看次数

标签 统计

binary ×1

image ×1

opencv ×1

python ×1