westracer / flutter_native_opencv

Using OpenCV natively in C++ in a Flutter app with Dart FFI
https://medium.com/flutter-community/integrating-c-library-in-a-flutter-app-using-dart-ffi-38a15e16bc14
MIT License
213 stars 38 forks source link

Some typos in readme and in code. #2

Closed ricardochen closed 3 years ago

ricardochen commented 3 years ago

First of all, thank you for your amazing tutorial.

There is a typo in the readme, specifically in: Contents of OpenCV-android-sdk/sdk/native/jni/libs/ to native_opencv/android/src/main/jniLibs should be OpenCV-android-sdk/sdk/native/libs/ instead of OpenCV-android-sdk/sdk/native/jni/libs/** (there is an extra "jni" in the path)

In code of native_opencv.cpp: you commented out the for-loop of "doing a lot of work" leaving out two required lines: adaptiveThreshold(input, threshed, 255, ADAPTIVE_THRESH_GAUSSIAN_C, THRESH_BINARY_INV, 77, 6); findContours(threshed, contours, hierarchy, RETR_TREE, CHAIN_APPROX_TC89_L1);

After fixing these minor issues, everything works phenomenally.

westracer commented 3 years ago

Hello. Thank you for your feedback.

You're right about native libs' location in OpenCV's SDK, but I'm not sure about "jni/libs" instead of "jniLibs", as I specified "jniLibs" folder in set_target_properties command's IMPORTED_LOCATION prop:

set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libopencv_java4.so)