Thank you! This is great work! I just heard about ffi before, and after listening to your explanation, I think nothing is impossible. Thank you so much,
my brain is cooked 😂 I did flutter + aruco videos on binge-mode. I was looking at Kivy-zbarcam for a starter wireup but this already includes aruco - outstanding.
This is a great video. Could you do a video or article on how you made the flutter plugin? The video when you integrated OPENCV into android is great, though I can't really grasp how to relate to it in a flutter plugin setting.
Hi, Thank you for your great tutorial! I have 1 question. When I run at the xcode in release mode, then It works well. BUT when i did archive and test at testflight, the camera couldn't recognize image. Do you know What's wrong? (I will change cpp file when i deploy my testing app so don't worry about anything. I just curious about possibility of dynamic library with ios)
Hi, thank you for your amazing work, these tutorials are super helpful. I've got a question : do you think it is possible to feed the camera preview with a modified image that would be provided by the OpenCV plugin ?
I believe the camera preview is using the native Android/ios preview layer. For example on Android it is probably some sort of GLRenderer. So if you want to change the preview you'll have to do it natively, and in the case of Android and a GLRenderer you won't be able to use OpenCV. Maybe you dont have to use a preview layer and just use an Image widget and change the image on new frame, on a fast cpu phone it might work, but I would not take it to production..
@@TheCodingNotebook Thanks for your answer ! Yes I was thinking about rendering the image flow as an OpenGL texture in a widget... there must be a solution... I'll check what can be done with the Flutter AR kit plugins too...
Hi Yuval Thanks for the excellent explanation is there a way to debug the c side of the plugin in the flutter app ? can you share resources for this Regards,
Just open your project in Android studio (the "android" folder), you should see there the native plugin with its cpp files. Just run in debug and set a breakpoint...
Did you make the aruco detector as a dll and use it using fft? Is the opencv function included in the dll? Or did you use the opencv android version separately?
I was using opencv for Android/ios in order to compile the code (statically) into a lib that is used by flutter ffi. (just like you would do when developing native for Android)
Theoretically yes, never done this. But if you know the marker size you can measure the distance between 2 points in "marker units" and then convert to real size (as longs as the points are on the same surface as the marker). But again, never tried to implement something like that. Obviously on mobile you would want to go with arkit/arcore
How would this change if targeting Windows? Or in general, using ffi/ffigen to access peripherals connected to the desktop (usb, bluetooth, etc )? For example, I have both 32-bit and 64-bit dlls that can access different hardware.. can flutter build/link with those dlls, and more importantly work when the dll functions are called? Any tips on 'Integrating C library in a desktop Flutter app using Dart FFI'?
Thank you for your amazing work, I need to count objects in real time using an android device, I would like to know if it is possible to count objects with opencv . Do you know some API for this problem? On the other hand, is there another way to count objects in real time (and offline) using an android device? Thank you in advance.
i have a small doubt i guess in the detect function of native_opencv.cpp file there is a code like follows Mat frame; if (isYUV) { Mat myyuv(height + height / 2, width, CV_8UC1, bytes); cvtColor(myyuv, frame, COLOR_YUV2BGRA_NV21); } else { frame = Mat(height, width, CV_8UC4, bytes); } what my doubt is that when it is in YUV format why we have to set height to ```height + height / 2``` to convert it to a Mat datatype ?
Hi, thanks for the tutorial ! I need some help. In native_opencv.cpp the ___attribute___ part triggers the error "C++ requires a type specifier for all declarations". This makes the flutter build crash. Do you have any idea how to resolve this issue ? Edit: I am on Windows btw
hello, thanks for your amazing tutorials and would like to use this project template to build a foot and mouth disease in cattle for my Bachelor ..and would like to be consulting you. how can i reach you?
Need to see exactly what is the error... make sure the path to opencv sdk is correct in CMakeLists.txt and that the minimum sdk version is 21 (I think I mention it in the movie)
how do you get that terminal window? Also, I don't get the second android folder when opening the android project under example in android studio. How do i fix this?
@@TheCodingNotebook with terminal i mean the terminal you used to create the arucodetector files and folder etc in the ios classes folder in the opencv section(4:20) of the video. With android folder i mean that the android project under example in the android studio section isn't showing the android project of the flutter opencv plugin project folder itself, so i only see the one under example when loaded into android studio(i can't see the plugin code in the project)(6:30)
@@TheCodingNotebook ok so i got it to work but only when i downloaded your git project and used your create command on it and after some changing of kotlin and gradle versions. I don't know what causes it to not work when i follow the tutorial from scratch. I think it has something to do with the flutter create command but i don't know what
@@TheCodingNotebook i found the solution, the flutter create command you use doesnt create the NativeOpencvPlugin.h and NativeOpencvPlugin.m files for me, so i had to create them manually
First make sure you opened the correct project "native_opencv/example/android", then sometimes choosing "File->Sync Prject with Gradle files" can help... other than that I don't have any further ideas....
When I try to open the native_opencv/example/android folder in android studio. In the project view the group module with native_opencv and app is missing. How do I get them to show up in the project view?
@@TheCodingNotebook can opencv run on serverside? I want to try in the dart language using a shared library single open cv is it possible? sorry I'm very new to opencv