How to add OpenCV module and dependency for Android Project
STEP 1) create project or open existing project(see example on previous page)
STEP 2) File->New -> Import Module
STEP 3) Now add the library to the project as a dependency
File->Project Structure
In Module section on left select "app" and go to dependencies tab, then hit + button to add MOdule Dependency
Now select the OpenCV Module
Here is the result -showing the added dependency of openCV
STEP 5) Add Native Libraries to your Project
Some files within OpenCV are native. This means they aren’t written in Java but C++. These files are available within the libs folder.
Copy the libs folder in the native folder over to your project app module main folder (Usually ProjectName/app/src/main).
Rename the libs folder you just copied into your project to jniLibs.
In android file view mode
Right Click on app-> “Link c++ project with gradle”
Now specify a ndk-build AND th make file that is shown below and located inside where you installed the OpenCV software on your system.