WeChat QR code detector for detecting and parsing QR code.#
Classes#
Name |
Description |
|---|---|
WeChat QRCode includes two CNN-based models: A object detection model and a super resolution model. Object detection model is applied to detect QRCode with the bounding box. super resolution model is applied to zoom in QRCode when it is small. |
Class cv::wechat_qrcode::WeChatQRCode#
WeChat QRCode includes two CNN-based models: A object detection model and a super resolution model. Object detection model is applied to detect QRCode with the bounding box. super resolution model is applied to zoom in QRCode when it is small.
#include <opencv2/wechat_qrcode.hpp>Collaboration diagram for cv::wechat_qrcode::WeChatQRCode:
Detailed Description#
WeChat QRCode includes two CNN-based models: A object detection model and a super resolution model. Object detection model is applied to detect QRCode with the bounding box. super resolution model is applied to zoom in QRCode when it is small.
Constructor & Destructor Documentation#
WeChatQRCode()#
cv::wechat_qrcode::WeChatQRCode::WeChatQRCode(
const std::string & detector_prototxt_path = “”,
const std::string & detector_caffe_model_path = “”,
const std::string & super_resolution_prototxt_path = “”,
const std::string & super_resolution_caffe_model_path = “” )
Python:
cv.wechat_qrcode.WeChatQRCode([, detector_prototxt_path[, detector_caffe_model_path[, super_resolution_prototxt_path[, super_resolution_caffe_model_path]]]]) -> <wechat_qrcode_WeChatQRCode object>
Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).
Parameters
detector_prototxt_path— prototxt file path for the detectordetector_caffe_model_path— caffe model file path for the detectorsuper_resolution_prototxt_path— prototxt file path for the super resolution modelsuper_resolution_caffe_model_path— caffe file path for the super resolution model
~WeChatQRCode()#
cv::wechat_qrcode::WeChatQRCode::~WeChatQRCode()
Member Function Documentation#
detectAndDecode()#
std::vector< std::string > cv::wechat_qrcode::WeChatQRCode::detectAndDecode(
InputArray img,
OutputArrayOfArrays points = noArray() )
Python:
cv.wechat_qrcode.WeChatQRCode.detectAndDecode(img[, points]) -> retval, points
Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode.
Parameters
img— supports grayscale or color (BGR) image.points— optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
Returns
list of decoded string.
Here is the call graph for this function:
getScaleFactor()#
float cv::wechat_qrcode::WeChatQRCode::getScaleFactor()
Python:
cv.wechat_qrcode.WeChatQRCode.getScaleFactor() -> retval
setScaleFactor()#
void cv::wechat_qrcode::WeChatQRCode::setScaleFactor(float _scalingFactor)
Python:
cv.wechat_qrcode.WeChatQRCode.setScaleFactor(_scalingFactor)
set scale factor QR code detector use neural network to detect QR. Before running the neural network, the input image is pre-processed by scaling. By default, the input image is scaled to an image with an area of 160000 pixels. The scale factor allows to use custom scale the input image: width = scaleFactorwidth height = scaleFactorwidth
scaleFactor valuse must be > 0 and <= 1, otherwise the scaleFactor value is set to -1 and use default scaled to an image with an area of 160000 pixels.
Member Data Documentation#
p#
Ptr< Impl > cv::wechat_qrcode::WeChatQRCode::p
Source file#
The documentation for this class was generated from the following file:
opencv2/wechat_qrcode.hpp