WeChatQRCode constructor

WeChatQRCode([
  1. String detectorPrototxtPath = "",
  2. String detectorCaffeModelPath = "",
  3. String superResolutionPrototxtPath = "",
  4. String superResolutionCaffeModelPath = "",
])

Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).

https://docs.opencv.org/4.x/d5/d04/classcv_1_1wechat__qrcode_1_1WeChatQRCode.html#a9c0dc4c37646a1a051340d6b0916f388

Implementation

factory WeChatQRCode([
  String detectorPrototxtPath = "",
  String detectorCaffeModelPath = "",
  String superResolutionPrototxtPath = "",
  String superResolutionCaffeModelPath = "",
]) {
  final arena = Arena();
  final p = calloc<cvg.WeChatQRCode>();
  final dp = detectorPrototxtPath.toNativeUtf8(allocator: arena).cast<ffi.Char>();
  final dm = detectorCaffeModelPath.toNativeUtf8(allocator: arena).cast<ffi.Char>();
  final srp = superResolutionPrototxtPath.toNativeUtf8(allocator: arena).cast<ffi.Char>();
  final srm = superResolutionCaffeModelPath.toNativeUtf8(allocator: arena).cast<ffi.Char>();
  cvRun(() => ccontrib.cv_wechat_qrcode_WeChatQRCode_create_1(dp, dm, srp, srm, p, ffi.nullptr));
  arena.releaseAll();
  return WeChatQRCode._(p);
}