I've been working on a program that opens an image and prints the decoded information of one or more QR codes. The code works and I can decode all of the QR codes, but the order is not what I expected it would be. As order does matter for the final program, I was wondering if anyone could help me determine how the decode searches through the picture for the codes (top to bottom, left to right, etc.). The following is the code that I use to find the QR codes:
from pyzbar.pyzbar import decode
from PIL import Image
img3 = Image.open('test4.jpg')
img3 = img3.rotate(270)
#img3.show()
result3 = decode(img3)
print(result3)
for i in result3:
print(i.data.decode("utf-8"))
In this case, the image shows QR code 1 and QR code 2 with QR1 on top and QR2 on the bottom. The whole image is sideways, so I rotated the image 270 degrees to get it to be right side up. It prints QR2 then QR1, but it doesn't seem to matter which way I rotate it, it always returns QR2 then QR1
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…