-
Notifications
You must be signed in to change notification settings - Fork 189
Description
Im using pyzbar to detect and decode barcodes in an jpg.
This jpg has multiple barcodes, but I need the Code128 one.
However, pyzbar only detects a sinlge barcode (its a Code39).
I have to cover the other barcode, in oder to detect the Code128 one.
I also tried to set the symbols argument to Code128, but doesnt work.
The image with the covered barcode:

This is my code:
import cv2
import PIL.Image
import pyzbar.pyzbar as pyzbar
im = PIL.Image.open("2.jpg")
decoded = pyzbar.decode(im)
print(decoded)
im = PIL.Image.open("2.jpg")
decoded = pyzbar.decode(im,symbols=[pyzbar.ZBarSymbol.CODE128])
print(decoded)
im = PIL.Image.open("2_test.jpg")
decoded = pyzbar.decode(im)
print(decoded)and Im getting following result:
[Decoded(data=b'0002', type='CODE39', rect=Rect(left=143, top=3296, width=6, height=0), polygon=[Point(x=143, y=3296), Point(x=149, y=3296)], quality=2, orientation='LEFT')]
[]
[Decoded(data=b'MO24-000830-1', type='CODE128', rect=Rect(left=154, top=6381, width=52, height=0), polygon=[Point(x=154, y=6381), Point(x=206, y=6381)], quality=10, orientation='LEFT')]
