-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QR code detecting in python with OpenCV raises UnicodeDecodeError: 'utf-8' codec can't decode byte #23728
Comments
Looking into this I enjoyed learning more about QR codes and python:
Code snippet:
These two issues sound related: |
Hi cpoerschke, |
I've switched to zxingcpp and this way it works: import cv2 |
zxingcpp seems way more reliable in this usecase... thanks @MKraemer85 otherwise if you wish to stick with cv2, |
a cool, good to know @flauer7 . Thanks for the input |
Fixed by this PR: #24350 |
Encode QR code data to UTF-8 #24350 ### Pull Request Readiness Checklist **Merge with extra**: opencv/opencv_extra#1105 resolves #23728 This is first PR in a series. Here we just return a raw Unicode. Later I will try expand QR codes decoding methods to use ECI assignment number and return a string with proper encoding, not only UTF-8 or raw unicode. See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Encode QR code data to UTF-8 opencv#24350 ### Pull Request Readiness Checklist **Merge with extra**: opencv/opencv_extra#1105 resolves opencv#23728 This is first PR in a series. Here we just return a raw Unicode. Later I will try expand QR codes decoding methods to use ECI assignment number and return a string with proper encoding, not only UTF-8 or raw unicode. See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Encode QR code data to UTF-8 opencv#24350 ### Pull Request Readiness Checklist **Merge with extra**: opencv/opencv_extra#1105 resolves opencv#23728 This is first PR in a series. Here we just return a raw Unicode. Later I will try expand QR codes decoding methods to use ECI assignment number and return a string with proper encoding, not only UTF-8 or raw unicode. See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Encode QR code data to UTF-8 opencv#24350 ### Pull Request Readiness Checklist **Merge with extra**: opencv/opencv_extra#1105 resolves opencv#23728 This is first PR in a series. Here we just return a raw Unicode. Later I will try expand QR codes decoding methods to use ECI assignment number and return a string with proper encoding, not only UTF-8 or raw unicode. See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
System Information
OpenCV python version: 4.7.0
Operating System: Windows 10
Python Version: Python 3.10.5
Detailed description
Related to this Question:
https://stackoverflow.com/questions/76362026/qr-code-detecting-in-python-with-opencv-raises-unicodedecodeerror-utf-8-codec
As I'm trying to detect an qr code and the qr code values, I get this error:
Steps to reproduce
Issue submission checklist
The text was updated successfully, but these errors were encountered: