Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Example Analysis of OpenCV4.0 Fast QR QR Code Detection

Shulou Source: shulou.com Published: 2022-06-01 12:51:23 10月03日 Update

OpenCV4.0 fast QR QR code detection example analysis, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

In recent years, due to the promotion of mobile payment by Wechat, QR code has become the standard of mobile phone App. Among many kinds of QR code, QR code is the most popular.

Just released OpenCV4.0-Alpha add fast QR QR code detection, OpenCV4.0-alpha release! The new deep learning features claim to be very fast, and the images of 640 to 480 can reach 80fps.

The official sample program name is:

Live_detect_qrcode.cpp

52CV Jun printed the "I love computer vision" official account of the QR code, shot a video containing this QR code with his mobile phone, the original video size is 1920 to 1080, because OpenCV officially announced the performance of the image test in 640 to 480, so the video will be taken with the same ratio of width and height to 740 to 416, keeping the number of pixels and 640 to 480 basically the same size.

In the official sample program, the core function called is only detectQRCode, whose parameter src is the input image, and transform is the detection result, which is a vector structure containing four vertex coordinates of QR code.

Isn't it easy?

The core process is also simple:

1) to convert an image to a grayscale image, only this preprocessing is needed.

2) call detectQRCode to detect the QR code

3) extract the Points from transform and draw bounding boxes and vertices.

52CV test machine CPU is i7 6850K, main frequency 3.4GHZ, memory 8GB, you can see from the video, the frame rate is basically stable between 70 and 80. In most cases, the detection results are good, but it can not be detected in the case of fast movement and some vertices are obscured.

OpenCV4.0-Alpha currently only has QR code detection and has not been decoded. The official version will contain the decoding part. Please look forward to it.

This is the answer to the sample analysis question about OpenCV4.0 fast QR QR code detection. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Tags: 2D QR code detection example image size analysis official video problem vertex only situation mobile phone more core program result part help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Tech Info vpn Apple Linux