找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 1914|回复: 0

[求助] 求助,识别条形码的时候,barcodes = decode(gray)出现问题

0

主题

0

帖子

0

积分

贫民

积分
0
Ja9527 发表于 2022-10-21 11:12:20 | 显示全部楼层 |阅读模式
import pyzbar.pyzbar as pyzbar
import numpy
from PIL import Image, ImageDraw, ImageFont
import cv2 as cv

frame = cv.imread("C:/Users/lzx/Desktop/ppic/123.png")

# 转为灰度图像
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
# cv2.imshow("a",gray)
# cv2.waitKey(0)
# cv2.destroyAllWindows()

barcodes = pyzbar.decode(gray)
print(barcodes)
print输出的是none,正常应该是解码的结果,怎么办,后续就无法迭代
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表