GraphicalCodeDetector
import { GraphicalCodeDetector } 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.
graphical code detector value in the OpenCV API.
Constructors and members
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.
detect
Detects graphical code in image and returns the quadrangle containing the code.
detect(img: Mat, points: Mat): boolean;imggrayscale or color (BGR) image containing (or not) graphical code.
pointsOutput destination, filled by the native operation. Output vector of vertices of the minimum-area quadrangle containing the code.
The boolean result.
decode
Decodes graphical 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.
decode(img: Mat, points: Mat, straight_code: Mat): string;2 available overloads
decode(img: Mat, points: Mat): string;decode(img: Mat, points: Mat, straight_code: Mat): string;imggrayscale or color (BGR) image containing graphical code.
pointsQuadrangle vertices found by detect() method (or some other algorithm).
straight_codeOutput destination, filled by the native operation. The optional output image containing binarized code, will be empty if not found.
The string result.
detectAndDecode
Both detects and decodes graphical code
detectAndDecode(img: Mat, points: Mat, straight_code: Mat): string;3 available overloads
detectAndDecode(img: Mat): string;detectAndDecode(img: Mat, points: Mat): string;detectAndDecode(img: Mat, points: Mat, straight_code: Mat): string;imggrayscale or color (BGR) image containing graphical code.
pointsOutput destination, filled by the native operation. optional output array of vertices of the found graphical code quadrangle, will be empty if not found.
straight_codeOutput destination, filled by the native operation. The optional output image containing binarized code
The string result.
detectMulti
Detects graphical codes in image and returns the vector of the quadrangles containing the codes.
detectMulti(img: Mat, points: Mat): boolean;imggrayscale or color (BGR) image containing (or not) graphical codes.
pointsOutput destination, filled by the native operation. Output vector of vector of vertices of the minimum-area quadrangle containing the codes.
The boolean result.
decodeMulti
Decodes graphical codes in image once it's found by the detect() method.
decodeMulti(img: Mat, points: Mat, decoded_info: StringVector, straight_code: MatVector): boolean;2 available overloads
decodeMulti(img: Mat, points: Mat, decoded_info: StringVector): boolean;decodeMulti(img: Mat, points: Mat, decoded_info: StringVector, straight_code: MatVector): boolean;imggrayscale or color (BGR) image containing graphical codes.
pointsvector of Quadrangle vertices found by detect() method (or some other algorithm).
decoded_infoOutput destination, filled by the native operation. UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
straight_codeOutput destination, filled by the native operation. The optional output vector of images containing binarized codes
The boolean result.
detectAndDecodeMulti
Both detects and decodes graphical codes
detectAndDecodeMulti(img: Mat, decoded_info: StringVector, points: Mat, straight_code: MatVector): boolean;3 available overloads
detectAndDecodeMulti(img: Mat, decoded_info: StringVector): boolean;detectAndDecodeMulti(img: Mat, decoded_info: StringVector, points: Mat): boolean;detectAndDecodeMulti(img: Mat, decoded_info: StringVector, points: Mat, straight_code: MatVector): boolean;imggrayscale or color (BGR) image containing graphical codes.
decoded_infoOutput destination, filled by the native operation. UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
pointsOutput destination, filled by the native operation. optional output vector of vertices of the found graphical code quadrangles. Will be empty if not found.
straight_codeOutput destination, filled by the native operation. The optional vector of images containing binarized codes
- If there are QR codes encoded with a Structured Append mode on the image and all of them detected and decoded correctly, method writes a full message to position corresponds to 0-th code in a sequence. The rest of QR codes from the same sequence have empty string.
The boolean result.
detectAndDecodeBytes
Both detects and decodes graphical code
detectAndDecodeBytes(img: Mat, points: Mat, straight_code: Mat): ucharVector;3 available overloads
detectAndDecodeBytes(img: Mat): ucharVector;detectAndDecodeBytes(img: Mat, points: Mat): ucharVector;detectAndDecodeBytes(img: Mat, points: Mat, straight_code: Mat): ucharVector;imggrayscale or color (BGR) image containing graphical code.
pointsOutput destination, filled by the native operation. optional output array of vertices of the found graphical code quadrangle, will be empty if not found.
straight_codeOutput destination, filled by the native operation. The optional output image containing binarized code
The ucharVector result. Release returned native handles with using or delete(), including handles nested in results.
decodeBytes
Decodes graphical 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.
decodeBytes(img: Mat, points: Mat, straight_code: Mat): ucharVector;2 available overloads
decodeBytes(img: Mat, points: Mat): ucharVector;decodeBytes(img: Mat, points: Mat, straight_code: Mat): ucharVector;imggrayscale or color (BGR) image containing graphical code.
pointsQuadrangle vertices found by detect() method (or some other algorithm).
straight_codeOutput destination, filled by the native operation. The optional output image containing binarized code, will be empty if not found.
The ucharVector result. Release returned native handles with using or delete(), including handles nested in results.
decodeBytesMulti
Decodes graphical codes in image once it's found by the detect() method.
decodeBytesMulti(img: Mat, points: Mat, decoded_info: std__vector_ucharVector, straight_code: MatVector): boolean;2 available overloads
decodeBytesMulti(img: Mat, points: Mat, decoded_info: std__vector_ucharVector): boolean;decodeBytesMulti(img: Mat, points: Mat, decoded_info: std__vector_ucharVector, straight_code: MatVector): boolean;imggrayscale or color (BGR) image containing graphical codes.
pointsvector of Quadrangle vertices found by detect() method (or some other algorithm).
decoded_infoOutput destination, filled by the native operation. UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
straight_codeOutput destination, filled by the native operation. The optional output vector of images containing binarized codes
The boolean result.
detectAndDecodeBytesMulti
Both detects and decodes graphical codes
detectAndDecodeBytesMulti(img: Mat, decoded_info: std__vector_ucharVector, points: Mat, straight_code: MatVector): boolean;3 available overloads
detectAndDecodeBytesMulti(img: Mat, decoded_info: std__vector_ucharVector): boolean;detectAndDecodeBytesMulti(img: Mat, decoded_info: std__vector_ucharVector, points: Mat): boolean;detectAndDecodeBytesMulti(img: Mat, decoded_info: std__vector_ucharVector, points: Mat, straight_code: MatVector): boolean;imggrayscale or color (BGR) image containing graphical codes.
decoded_infoOutput destination, filled by the native operation. UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
pointsOutput destination, filled by the native operation. optional output vector of vertices of the found graphical code quadrangles. Will be empty if not found.
straight_codeOutput destination, filled by the native operation. The optional vector of images containing binarized codes
- If there are QR codes encoded with a Structured Append mode on the image and all of them detected and decoded correctly, method writes a full message to position corresponds to 0-th code in a sequence. The rest of QR codes from the same sequence have empty string.
The boolean 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.