我是靠谱客的博主 个性白开水,这篇文章主要介绍python 二维码解析,现在分享给大家,希望可以做个参考。

1.环境

复制代码
1
2
3
4
5
6
7
mac brew install zbar pip install pyzbar pip install opencv-python centos8 yum install zbar-devel pip insatll pyzbar

2.使用

复制代码
1
2
3
4
5
6
7
from pyzbar import pyzbar import numpy as np import cv2 img_data = cv2.imread("csdn.png") # 转为灰度图像 gray = cv2.cvtColor(img_data, cv2.COLOR_BGR2GRAY) barcodes = pyzbar.decode(gray)[0].data.decode("utf-8")# 二维码内容

3.ImportError: Unable to find zbar shared library
直接调用系统环境是能执行,但是pycharm虚拟环境报错

最后

以上就是个性白开水最近收集整理的关于python 二维码解析的全部内容,更多相关python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(76)

评论列表共有 0 条评论

立即
投稿
返回
顶部