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
imgInputArraygrayscale or color (BGR) image containing QR code.
pointsIEnumerable<Point2f>Quadrangle vertices found by detect() method (or some other algorithm).
straightQrCodeOutputArrayThe optional output image containing rectified and binarized QR code
Returns
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
imgInputArraygrayscale or color (BGR) image containing QR code.
pointsIEnumerable<Point2f>Quadrangle vertices found by detect() method (or some other algorithm).
decodedInfostring[]UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
Returns
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
imgInputArraygrayscale or color (BGR) image containing QR code.
pointsIEnumerable<Point2f>Quadrangle vertices found by detect() method (or some other algorithm).
decodedInfostring[]UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
straightQrCodeMat[]The optional output image containing rectified and binarized QR code
Returns
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
imgInputArraygrayscale or color (BGR) image containing QR code.
pointsIEnumerable<Point2f>Quadrangle vertices found by detect() method (or some other algorithm).
decodedInfostring[]UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
straightQrCodeMat[]The optional output image containing rectified and binarized QR code
isOutputStraightQrCodebooltrue to output
straightQrCode
Returns
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
imgInputArraygrayscale or color (BGR) image containing (or not) QR code.
pointsPoint2f[]Output vector of vertices of the minimum-area quadrangle containing the code.
Returns
DetectAndDecode(InputArray, out Point2f[], OutputArray?)
Both detects and decodes QR code
public string DetectAndDecode(InputArray img, out Point2f[] points, OutputArray? straightQrCode = null)
Parameters
imgInputArraygrayscale or color (BGR) image containing QR code.
pointsPoint2f[]optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
straightQrCodeOutputArrayThe optional output image containing rectified and binarized QR code
Returns
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
imgInputArraygrayscale or color (BGR) image containing (or not) QR code.
pointsPoint2f[]Output vector of vertices of the minimum-area quadrangle containing the codes.
Returns
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
epsXdoubleEpsilon 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
epsYdoubleEpsilon neighborhood, which allows you to determine the vertical pattern of the scheme 1:1:3:1:1 according to QR code standard.