Table of Contents

Class WeChatQRCode

Namespace
Emgu.CV
Assembly
Emgu.CV.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 : 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 string

Prototxt file path for the detector

detectorCaffeModelPath string

Caffe model file path for the detector

superResolutionPrototxtPath string

Prototxt file path for the super resolution model

superResolutionCaffeModelPath string

Caffe file path for the super resolution model

Methods

DetectAndDecode(IInputArray)

Both detects and decodes QR code.

public WeChatQRCode.QRCode[] DetectAndDecode(IInputArray img)

Parameters

img IInputArray

Supports 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 IInputArray

Supports grayscale or color (BGR) image

points IOutputArrayOfArrays

Optional 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()