Path: blob/master/WeChat-QRCode-Scanner-OpenCV/Python/WeChat-qrcode-scanner.ipynb
3162 views
WeChat QR Code Scanner
WeChat QR code scanner is a CNN-based high-performance and lightweight QR code detect and decode library. Contributed by the 3rd-party WeChat CV Team. It was released with OpenCV 4.5.2. It has been widely used in various Tencent applications, including WeChat, WeCom, QQ, QQ Browser, and so on. Checkout this link for more information.
In this notebook, you are going to learn implementation of WeChat QR Code scanner. We will also compare the default OpenCV QR code scanner with it.
WeChat QR Code Scanner in OpenCV
Function Syntax
Instantiating detector object.
Detect and decode.
PARAMETERS
ret : returns list of decoded string.
points : optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
src : gray scale or color image.
The model files can be downloaded from this link.
OpenCV Documentation
Import Libraries
Define utility function to draw bounding box
Instantiate QR Code detector object
Load image
Decode and display results
Upon execution, we get the decoded data, the bounding box and the time taken in milliseconds to process the image.
OpenCV vs WeChat Comparison
Let us perform test on a QR code video and compare on the basis of following.
Zoomed out (near / far)
Blurred.
Occluded.
Darkened.
Rotated.