0

I am using the code below to decode code from an image. This works fine with a QR code but not with a 2D datamatrix.

def read_qr_code(filename):
    try:
        img = cv2.imread(filename)
        detect = cv2.QRCodeDetector()
        value, points, straight_qrcode = detect.detectAndDecode(img)
        return value
    except:
        print ('Error')
        return
read_qr_code('single.jpg')

How can I change it to decode 2D code?

gtomer
  • 5,643
  • 1
  • 10
  • 21
  • Does this answer your question? [How to read data matrix code in Python?](https://stackoverflow.com/questions/48686574/how-to-read-data-matrix-code-in-python) – jasonharper Jul 10 '23 at 14:13

0 Answers0