3

I'm very new to flutter. I'm trying to send an image from my OpenCV-C++ code to flutter for iOS device through dart:ffi.

I first converted cv::Mat to vector. I'm not sure if this is a right approach.

Still, I'm stuck at how to define lookup function. My image processing function in C++ return a vector of unsigned char. Below is my current lookup function. It debugs without errors but it crashes when I call this function in flutter.

final Pointer<Uint8> Function() imageProcess = nativeAddLib
.lookup<NativeFunction<Pointer<Uint8> Function()>>('image_process')
.asFunction();

How should I send cv:Mat (or vector) from C++ to flutter?

fai
  • 31
  • 1
  • Add some of the C code, i.e. `image_process`. What does the vector represent and how are you going to use it? What Dart datatype do you want to convert it into as you return from C to Dart? – Richard Heap Jun 12 '20 at 15:06

0 Answers0