Class 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.
public class WeChatQRCode : UnmanagedObject, IDisposable
- Inheritance
-
WeChatQRCode
- Implements
- Inherited Members
Constructors
WeChatQRCode(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 WeChatQRCode(string detectorPrototxtPath, string detectorCaffeModelPath, string superResolutionPrototxtPath, string superResolutionCaffeModelPath)
Parameters
detectorPrototxtPath
stringPrototxt file path for the detector
detectorCaffeModelPath
stringCaffe model file path for the detector
superResolutionPrototxtPath
stringPrototxt file path for the super resolution model
superResolutionCaffeModelPath
stringCaffe file path for the super resolution model
Methods
DetectAndDecode(IInputArray)
Both detects and decodes QR code.
public WeChatQRCode.QRCode[] DetectAndDecode(IInputArray img)
Parameters
img
IInputArraySupports grayscale or color (BGR) image
Returns
- QRCode[]
The detected QRCode.
DetectAndDecode(IInputArray, IOutputArrayOfArrays)
Both detects and decodes QR code.
public string[] DetectAndDecode(IInputArray img, IOutputArrayOfArrays points)
Parameters
img
IInputArraySupports grayscale or color (BGR) image
points
IOutputArrayOfArraysOptional output array of vertices of the found QR code quadrangle. Will be empty if not found.
Returns
- string[]
The array of decoded string.
DisposeObject()
Release the unmanaged memory associated with this object
protected override void DisposeObject()