detectAndDecode method
(String, VecPoint, Mat)
detectAndDecode(
- InputArray img, {
- VecPoint? points,
- OutputArray? straightCode,
DetectAndDecode Both detects and decodes QR code.
Returns true as long as some QR code was detected even in case where the decoding failed For further details, please see: https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a7290bd6a5d59b14a37979c3a14fbf394
Implementation
(String ret, VecPoint points, Mat straightCode) detectAndDecode(
InputArray img, {
VecPoint? points,
OutputArray? straightCode,
}) {
final code = straightCode?.ptr ?? calloc<cvg.Mat>();
final points = calloc<cvg.VecPoint>();
final v = calloc<ffi.Pointer<ffi.Char>>();
cvRun(() => cobjdetect.cv_QRCodeDetector_detectAndDecode(ref, img.ref, points, code, v, ffi.nullptr));
final s = v == ffi.nullptr ? "" : v.value.cast<Utf8>().toDartString();
calloc.free(v);
return (s, VecPoint.fromPointer(points), Mat.fromPointer(code));
}