You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing the performance of various QR code detection libraries using "perfect" version 1-H QR codes generated by segno, and I noticed that some of these codes could not be detected. In particular, the following 192 values failed to be detected when testing exhaustively in the range $[0, 10^6]$:
This issue was not exclusive to pyzxing, and other tested libraries such as OpenCV and BoofCV also had issues with some payloads (although for different values), which are confirmed as a bug due to false positives in the finder pattern (which may or may not be the same issue in this case) - see lessthanoptimal/PyBoof#23. Please note that there is also an identified bug in segno in which the padding is malformed for 4-digit payloads - see heuer/segno#123, although this does not seem to affect pyzxing as I'm assuming you ignore the padding bits (which seems to be a strategy employed by many detector libraries).
Steps to reproduce
importcv2importsegnofrompyzxingimportBarCodeReaderTEST_FILE='qr_test.png'reader=BarCodeReader()
bad_detections= []
foriinrange(0, 100000):
qrcode=segno.make(i, version=1)
assertqrcode.error=='H'qrcode.save(TEST_FILE, scale=5)
img=cv2.imread(TEST_FILE)
img=cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img=cv2.resize(img, (88, 88))
barcodes=reader.decode_array(img)
assertlen(barcodes) ==1if'raw'notinbarcodes[0]:
print(f"Unable to detect {i}")
bad_detections.append(i)
else:
assertbarcodes[0]['raw'].decode("utf-8") ==str(i), f"Mismatch between detected value {barcodes[0]['raw'].decode("utf-8")} and input {x}"print(f"Unable to detect the following data payloads:\n{bad_detections}")
The text was updated successfully, but these errors were encountered:
System Information
Operating System: Ubuntu 22.04
Python version: 3.10.6
.venv dump (
pip freeze
) - also contains other QR detection libraries which were tested:Detailed description
I was testing the performance of various QR code detection libraries using "perfect" version 1-H QR codes generated by$[0, 10^6]$ :
segno
, and I noticed that some of these codes could not be detected. In particular, the following 192 values failed to be detected when testing exhaustively in the rangeThis issue was not exclusive to pyzxing, and other tested libraries such as
OpenCV
andBoofCV
also had issues with some payloads (although for different values), which are confirmed as a bug due to false positives in the finder pattern (which may or may not be the same issue in this case) - see lessthanoptimal/PyBoof#23. Please note that there is also an identified bug insegno
in which the padding is malformed for 4-digit payloads - see heuer/segno#123, although this does not seem to affect pyzxing as I'm assuming you ignore the padding bits (which seems to be a strategy employed by many detector libraries).Steps to reproduce
The text was updated successfully, but these errors were encountered: