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,
}) {
straightCode ??= Mat.empty();
final points = VecPoint();
final v = calloc<ffi.Pointer<ffi.Char>>();
cvRun(() => cobjdetect.cv_QRCodeDetector_detectAndDecode(
ref, img.ref, points.ptr, straightCode!.ptr, v, ffi.nullptr));
final s = v == ffi.nullptr ? "" : v.value.cast<Utf8>().toDartString();
calloc.free(v);
return (s, points, straightCode);
}