我正在使用Pyzbar解码我的CODABAR设计,尽管灰度图像看起来可以很好地照亮,但PyZbar似乎无法对其进行解码。因此,我用mean&otsu对其进行阈值处理,获得了附带的二进制图像,但仍然无法对其进行解码。我将条形码类型指定为CODABAR
from pyzbar.pyzbar import decode
from pyzbar.pyzbar import ZBarSymbol
import cv2
import math
from scipy import ndimage
import numpy as np
percentile = np.percentile(identifier, 70)
_, identifier_binary = cv2.threshold(identifier,0,255, cv2.THRESH_BINARY + cv2.THRESH_OTSU )
id = decode(identifier_binary, [ZBarSymbol.CODABAR])