QRCodeDetector
import { QRCodeDetector } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits GraphicalCodeDetector.
QR code detector.
Constructors and members
static new
Create an owned QRCodeDetector object. Release native handles with using or delete().
new(): QRCodeDetector;The QRCodeDetector result.
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
setEpsX
sets the epsilon used during the horizontal scan of QR code stop marker detection.
setEpsX(epsX: number): QRCodeDetector;epsXEpsilon neighborhood, which allows you to determine the horizontal pattern of the scheme 1:1:3:1:1 according to QR code standard.
The QRCodeDetector result.
setEpsY
sets the epsilon used during the vertical scan of QR code stop marker detection.
setEpsY(epsY: number): QRCodeDetector;epsYEpsilon neighborhood, which allows you to determine the vertical pattern of the scheme 1:1:3:1:1 according to QR code standard.
The QRCodeDetector result.
setUseAlignmentMarkers
use markers to improve the position of the corners of the QR code
alignmentMarkers using by default
setUseAlignmentMarkers(useAlignmentMarkers: boolean): QRCodeDetector;useAlignmentMarkersuse alignment markers argument (boolean).
The QRCodeDetector result.
decodeCurved
Decodes QR code on a curved surface in image once it's found by the detect() method.
Returns UTF8-encoded output string or empty string if the code cannot be decoded.
decodeCurved(img: Mat, points: Mat, straight_qrcode: Mat): string;2 available overloads
decodeCurved(img: Mat, points: Mat): string;decodeCurved(img: Mat, points: Mat, straight_qrcode: Mat): string;imggrayscale or color (BGR) image containing QR code.
pointsQuadrangle vertices found by detect() method (or some other algorithm).
straight_qrcodeOutput destination, filled by the native operation. The optional output image containing rectified and binarized QR code
The string result.
detectAndDecodeCurved
Both detects and decodes QR code on a curved surface
detectAndDecodeCurved(img: Mat, points: Mat, straight_qrcode: Mat): string;3 available overloads
detectAndDecodeCurved(img: Mat): string;detectAndDecodeCurved(img: Mat, points: Mat): string;detectAndDecodeCurved(img: Mat, points: Mat, straight_qrcode: Mat): string;imggrayscale or color (BGR) image containing QR code.
pointsOutput destination, filled by the native operation. optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
straight_qrcodeOutput destination, filled by the native operation. The optional output image containing rectified and binarized QR code
The string result.
getEncoding
Returns a kind of encoding for the decoded info from the latest decode or detectAndDecode call
getEncoding(codeIdx: number): number;2 available overloads
getEncoding(): number;getEncoding(codeIdx: number): number;codeIdxan index of the previously decoded QR code. When
decodeordetectAndDecodeis used, valid value is zero. FordecodeMultiordetectAndDecodeMultiuse indices corresponding to the output order.
The number result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.