Table of Contents

Class QRCodeDetector

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll
public class QRCodeDetector : DisposableCvObject, IDisposable, ICvPtrHolder
Inheritance
QRCodeDetector
Implements
Inherited Members

Constructors

QRCodeDetector()

public QRCodeDetector()

Methods

Decode(InputArray, IEnumerable<Point2f>, OutputArray?)

Decodes QR code in image once it's found by the detect() method. Returns UTF8-encoded output string or empty string if the code cannot be decoded.

public string Decode(InputArray img, IEnumerable<Point2f> points, OutputArray? straightQrCode = null)

Parameters

img InputArray

grayscale or color (BGR) image containing QR code.

points IEnumerable<Point2f>

Quadrangle vertices found by detect() method (or some other algorithm).

straightQrCode OutputArray

The optional output image containing rectified and binarized QR code

Returns

string

DecodeMulti(InputArray, IEnumerable<Point2f>, out string?[])

Decodes QR codes in image once it's found by the detect() method. Returns UTF8-encoded output string or empty string if the code cannot be decoded.

public bool DecodeMulti(InputArray img, IEnumerable<Point2f> points, out string?[] decodedInfo)

Parameters

img InputArray

grayscale or color (BGR) image containing QR code.

points IEnumerable<Point2f>

Quadrangle vertices found by detect() method (or some other algorithm).

decodedInfo string[]

UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.

Returns

bool

DecodeMulti(InputArray, IEnumerable<Point2f>, out string?[], out Mat[])

Decodes QR codes in image once it's found by the detect() method. Returns UTF8-encoded output string or empty string if the code cannot be decoded.

public bool DecodeMulti(InputArray img, IEnumerable<Point2f> points, out string?[] decodedInfo, out Mat[] straightQrCode)

Parameters

img InputArray

grayscale or color (BGR) image containing QR code.

points IEnumerable<Point2f>

Quadrangle vertices found by detect() method (or some other algorithm).

decodedInfo string[]

UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.

straightQrCode Mat[]

The optional output image containing rectified and binarized QR code

Returns

bool

DecodeMulti(InputArray, IEnumerable<Point2f>, out string?[], out Mat[], bool)

Decodes QR codes in image once it's found by the detect() method. Returns UTF8-encoded output string or empty string if the code cannot be decoded.

protected bool DecodeMulti(InputArray img, IEnumerable<Point2f> points, out string?[] decodedInfo, out Mat[] straightQrCode, bool isOutputStraightQrCode)

Parameters

img InputArray

grayscale or color (BGR) image containing QR code.

points IEnumerable<Point2f>

Quadrangle vertices found by detect() method (or some other algorithm).

decodedInfo string[]

UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.

straightQrCode Mat[]

The optional output image containing rectified and binarized QR code

isOutputStraightQrCode bool

true to output straightQrCode

Returns

bool

Detect(InputArray, out Point2f[])

Detects QR code in image and returns the quadrangle containing the code.

public bool Detect(InputArray img, out Point2f[] points)

Parameters

img InputArray

grayscale or color (BGR) image containing (or not) QR code.

points Point2f[]

Output vector of vertices of the minimum-area quadrangle containing the code.

Returns

bool

DetectAndDecode(InputArray, out Point2f[], OutputArray?)

Both detects and decodes QR code

public string DetectAndDecode(InputArray img, out Point2f[] points, OutputArray? straightQrCode = null)

Parameters

img InputArray

grayscale or color (BGR) image containing QR code.

points Point2f[]

optional output array of vertices of the found QR code quadrangle. Will be empty if not found.

straightQrCode OutputArray

The optional output image containing rectified and binarized QR code

Returns

string

DetectMulti(InputArray, out Point2f[])

Detects QR codes in image and returns the quadrangles containing the codes.

public bool DetectMulti(InputArray img, out Point2f[] points)

Parameters

img InputArray

grayscale or color (BGR) image containing (or not) QR code.

points Point2f[]

Output vector of vertices of the minimum-area quadrangle containing the codes.

Returns

bool

DisposeUnmanaged()

Releases unmanaged resources

protected override void DisposeUnmanaged()

SetEpsX(double)

sets the epsilon used during the horizontal scan of QR code stop marker detection.

public void SetEpsX(double epsX)

Parameters

epsX double

Epsilon neighborhood, which allows you to determine the horizontal pattern of the scheme 1:1:3:1:1 according to QR code standard.

SetEpsY(double)

sets the epsilon used during the vertical scan of QR code stop marker detection.

public void SetEpsY(double epsY)

Parameters

epsY double

Epsilon neighborhood, which allows you to determine the vertical pattern of the scheme 1:1:3:1:1 according to QR code standard.