Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to decode QR Codes with particular payloads #23810

Open
Assignees
AleksandrPanov
Labels
@simon-staal

Description

@simon-staal

System Information

OpenCV python version: 4.7.0.72
Operating System: Ubuntu 22.04
Python version: 3.10.6

.venv dump (pip freeze) - also contains other QR detection libraries which were tested:

joblib==1.2.0numpy==1.24.3opencv-python==4.7.0.72py4j==0.10.9.7PyBoof==0.41pyzbar==0.1.9pyzxing==1.0.2segno==1.5.2six==1.16.0transforms3d==0.4.1

Detailed description

I was testing the performance of various QR code detection libraries using "perfect" version 1-H QR codes generated bysegno, and I noticed that some of these codes could not be detected. In particular, the following values failed to be detected when testing exhaustively in the range$[0, 10^6]$:

9133, 24901, 27002, 28211, 30270, 33094, 36997, 37379, 51851, 62533, 63856, 70558, 71054, 74397, 76142, 79599, 91536

This issue was not exclusive to OpenCV, and other tested libraries such asBoofCV 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) - seelessthanoptimal/PyBoof#23. Please note that there is also an identified bug insegno in which the padding is malformed for 4-digit payloads - seeheuer/segno#123, although this does not seem to affect OpenCV as I'm assuming you ignore the padding bits (which seems to be a strategy employed by many detector libraries).

Steps to reproduce

importcv2importsegnoTEST_FILE='qr_test.png'qr_opencv=cv2.QRCodeDetector()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))detected,points,straight_qrcode=qr_opencv.detectAndDecode(img)ifnotdetected:print(f"Unable to detect{i}")bad_detections.append(i)else:assertstr(detected)==str(i),f"Mismatch between detected value{detected} and input{x}"print(f"Unable to detect the following data payloads:\n{bad_detections}")

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp