wechat qrcode UnicodeDecodeError in python3.6.9

Author: frotmsCreated Feb 2, 2021Updated Aug 22, 2026
Labelsbugcategory: python bindingsconfirmed

I modified repository of opencv/opencv-python and got .whl with wechat_qrcode. UnicodeDecodeError happens in some qrcode-images.

Env: python3.6.9 unbuntu18.04

Code:

import
detector = cv2.wechat_qrcode_WeChatQRCode("detect.prototxt", "detect.caffemodel", "sr.prototxt", "sr.caffemodel")
img = cv2.imread("img.jpg")
res, points = detector.detectAndDecode(img)

And I got information below: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 2: invalid continuation byte