QRCodeDetector

Objective-C

@interface QRCodeDetector : NSObject

Swift

class QRCodeDetector : NSObject

Groups the object candidate rectangles. rectList Input/output vector of rectangles. Output vector includes retained and grouped rectangles. (The Python list is not modified in place.) weights Input/output vector of weights of rectangles. Output vector includes weights of retained and grouped rectangles. (The Python list is not modified in place.) groupThreshold Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it. eps Relative difference between sides of the rectangles to merge them into a group.

Member of Objdetect

Methods

  • Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init()
  • Decodes QR codes in image once it’s found by the detect() method.

    Declaration

    Objective-C

    - (BOOL)decodeMulti:(nonnull Mat *)img
                 points:(nonnull Mat *)points
           decoded_info:(nonnull NSMutableArray<NSString *> *)decoded_info
        straight_qrcode:(nonnull NSMutableArray<Mat *> *)straight_qrcode;

    Swift

    func decodeMulti(img: Mat, points: Mat, decoded_info: NSMutableArray, straight_qrcode: NSMutableArray) -> Bool

    Parameters

    img

    grayscale or color (BGR) image containing QR codes.

    decoded_info

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

    points

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

    straight_qrcode

    The optional output vector of images containing rectified and binarized QR codes

  • Decodes QR codes in image once it’s found by the detect() method.

    Declaration

    Objective-C

    - (BOOL)decodeMulti:(nonnull Mat *)img
                 points:(nonnull Mat *)points
           decoded_info:(nonnull NSMutableArray<NSString *> *)decoded_info;

    Swift

    func decodeMulti(img: Mat, points: Mat, decoded_info: NSMutableArray) -> Bool

    Parameters

    img

    grayscale or color (BGR) image containing QR codes.

    decoded_info

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

    points

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

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

    Declaration

    Objective-C

    - (BOOL)detect:(nonnull Mat *)img points:(nonnull Mat *)points;

    Swift

    func detect(img: Mat, points: Mat) -> Bool

    Parameters

    img

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

    points

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

  • Both detects and decodes QR codes

    Declaration

    Objective-C

    - (BOOL)detectAndDecodeMulti:(nonnull Mat *)img
                    decoded_info:(nonnull NSMutableArray<NSString *> *)decoded_info
                          points:(nonnull Mat *)points
                 straight_qrcode:(nonnull NSMutableArray<Mat *> *)straight_qrcode;

    Swift

    func detectAndDecodeMulti(img: Mat, decoded_info: NSMutableArray, points: Mat, straight_qrcode: NSMutableArray) -> Bool

    Parameters

    img

    grayscale or color (BGR) image containing QR codes.

    decoded_info

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

    points

    optional output vector of vertices of the found QR code quadrangles. Will be empty if not found.

    straight_qrcode

    The optional output vector of images containing rectified and binarized QR codes

  • Both detects and decodes QR codes

    Declaration

    Objective-C

    - (BOOL)detectAndDecodeMulti:(nonnull Mat *)img
                    decoded_info:(nonnull NSMutableArray<NSString *> *)decoded_info
                          points:(nonnull Mat *)points;

    Swift

    func detectAndDecodeMulti(img: Mat, decoded_info: NSMutableArray, points: Mat) -> Bool

    Parameters

    img

    grayscale or color (BGR) image containing QR codes.

    decoded_info

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

    points

    optional output vector of vertices of the found QR code quadrangles. Will be empty if not found.

  • Both detects and decodes QR codes

    Declaration

    Objective-C

    - (BOOL)detectAndDecodeMulti:(nonnull Mat *)img
                    decoded_info:(nonnull NSMutableArray<NSString *> *)decoded_info;

    Swift

    func detectAndDecodeMulti(img: Mat, decoded_info: NSMutableArray) -> Bool

    Parameters

    img

    grayscale or color (BGR) image containing QR codes.

    decoded_info

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

  • Detects QR codes in image and returns the vector of the quadrangles containing the codes.

    Declaration

    Objective-C

    - (BOOL)detectMulti:(nonnull Mat *)img points:(nonnull Mat *)points;

    Swift

    func detectMulti(img: Mat, points: Mat) -> Bool

    Parameters

    img

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

    points

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

  • 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.
    

    Declaration

    Objective-C

    - (nonnull NSString *)decode:(nonnull Mat *)img
                          points:(nonnull Mat *)points
                 straight_qrcode:(nonnull Mat *)straight_qrcode;

    Swift

    func decode(img: Mat, points: Mat, straight_qrcode: Mat) -> String

    Parameters

    img

    grayscale or color (BGR) image containing QR code.

    points

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

    straight_qrcode

    The optional output image containing rectified and binarized QR code

  • 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.
    

    Declaration

    Objective-C

    - (nonnull NSString *)decode:(nonnull Mat *)img points:(nonnull Mat *)points;

    Swift

    func decode(img: Mat, points: Mat) -> String

    Parameters

    img

    grayscale or color (BGR) image containing QR code.

    points

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

  • Both detects and decodes QR code

    Declaration

    Objective-C

    - (nonnull NSString *)detectAndDecode:(nonnull Mat *)img
                                   points:(nonnull Mat *)points
                          straight_qrcode:(nonnull Mat *)straight_qrcode;

    Swift

    func detectAndDecode(img: Mat, points: Mat, straight_qrcode: Mat) -> String

    Parameters

    img

    grayscale or color (BGR) image containing QR code.

    points

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

    straight_qrcode

    The optional output image containing rectified and binarized QR code

  • Both detects and decodes QR code

    Declaration

    Objective-C

    - (nonnull NSString *)detectAndDecode:(nonnull Mat *)img
                                   points:(nonnull Mat *)points;

    Swift

    func detectAndDecode(img: Mat, points: Mat) -> String

    Parameters

    img

    grayscale or color (BGR) image containing QR code.

    points

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

  • Both detects and decodes QR code

    Declaration

    Objective-C

    - (nonnull NSString *)detectAndDecode:(nonnull Mat *)img;

    Swift

    func detectAndDecode(img: Mat) -> String

    Parameters

    img

    grayscale or color (BGR) image containing QR code.

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

    Declaration

    Objective-C

    - (void)setEpsX:(double)epsX;

    Swift

    func setEpsX(epsX: Double)

    Parameters

    epsX

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

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

    Declaration

    Objective-C

    - (void)setEpsY:(double)epsY;

    Swift

    func setEpsY(epsY: Double)

    Parameters

    epsY

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