You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi friends, I bumped into this project just the other day as I was thinking about ways to make OpenCV smaller in an app that I maintain.
The problem is that I have zero experience with CMake or JNI at all, so the instructions provided in the Readme file aren't sufficent for me.
I have extracted the zip file into my projects src/main/jni. Also created the CMakeLists (that I never had) and added the configuration you provided in the readme, but saw a couple of problems and with some searching I ended up with this:
cmake_minimum_required(VERSION 3.4.1)
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-4.9.0-android/sdk/native/jni)
find_package(OpenCV REQUIRED)
if(OpenCV_FOUND)
message("OpenCV found successfully")
include_directories(${OpenCV_INCLUDE_DIRS})
# Link against OpenCV libraries
# target_link_libraries(your_target_library ${OpenCV_LIBRARIES})
else()
message(FATAL_ERROR "OpenCV not found")
endif()
add_library( # Sets the name of the library.
native_lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
../cpp/native_lib.cpp)
# Link your library with OpenCV
target_link_libraries(native_lib ${OpenCV_LIBS})
native_lib.cpp is the c++ file that imports openCV and does things.
Hi friends, I bumped into this project just the other day as I was thinking about ways to make OpenCV smaller in an app that I maintain.
The problem is that I have zero experience with CMake or JNI at all, so the instructions provided in the Readme file aren't sufficent for me.
I have extracted the zip file into my projects
src/main/jni
. Also created the CMakeLists (that I never had) and added the configuration you provided in the readme, but saw a couple of problems and with some searching I ended up with this:It still doesn't work, but it now complains that
The text was updated successfully, but these errors were encountered: