Class WeChatQRCode
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
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.
public class WeChatQRCode : DisposableCvObject, IDisposable, ICvPtrHolder
- Inheritance
-
WeChatQRCode
- Implements
- Inherited Members
Methods
Create(string, string, string, string)
Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).
public static WeChatQRCode Create(string detectorPrototxtPath, string detectorCaffeModelPath, string superResolutionPrototxtPath, string superResolutionCaffeModelPath)
Parameters
detectorPrototxtPathstringprototxt file path for the detector
detectorCaffeModelPathstringcaffe model file path for the detector
superResolutionPrototxtPathstringprototxt file path for the super resolution model
superResolutionCaffeModelPathstringcaffe file path for the super resolution model
Returns
Exceptions
DetectAndDecode(InputArray, out Mat[], out string[])
Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode
public void DetectAndDecode(InputArray inputImage, out Mat[] bbox, out string[] results)
Parameters
inputImageInputArraysupports grayscale or color(BGR) image.
bboxMat[]optional output array of vertices of the found QR code quadrangle.Will be empty if not found.
resultsstring[]list of decoded string.
DisposeManaged()
Releases managed resources
protected override void DisposeManaged()