Skip to content

Single black pixel breaks QR code detect #24450

@dkurt

Description

@dkurt

System Information

OpenCV: a3b3a58

Detailed description

Using an image qrcode-kanji_mod.png with a single extra black pixel on specific location breaks detection.

Steps to reproduce

import cv2 as cv
img = cv.imread("qrcode-kanji_mod.png")
detect = cv.QRCodeDetector()
det = detect.detect(img)
print("1:", det)

img = cv.imread("qrcode-kanji_mod.png")
img[-1, 296] = 0
detect = cv.QRCodeDetector()
det = detect.detect(img)
print("2:", det)
1: (True, array([[[  9.,   4.],
        [632.,   4.],
        [632., 628.],
        [  9., 628.]]], dtype=float32))
2: (False, None)

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

Relationships

None yet

Development

No branches or pull requests

Issue actions