2025-08-18 11:06:42 +08:00

10 lines
363 B
Python
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from pyzxing import BarCodeReader
reader = BarCodeReader()
results = reader.decode('binary_qrcode-A1.jpg')
print(results[0])
# # 支持输入文件模式以检测多个文件
# results = reader.decode('/PATH/TO/FILES/*.png')
# print(results)
# 支持传入图片的向量
# 需要额外安装opencvpip install opencv-python
# results = reader.decode_array(img)