This application is a sample of the OpenCV in Android.
In the sample we use the OpenCV SDK
to detect faces.
The application has been tested with:
- Android Compile SDK '28'
- Android Build Tools '28.0.3'
- Gradle '3.4.2'
- OpenCV SDK '3.4.3'
Here is how to use this project to run native OpenCV code.
- Make sure you have
Android SDKup to date, withNDKinstalled - Download OpenCV SDK 3.4.3 for Android from OpenCV.org and decompress the zip file.
- Clone this project
- Create a symlink named
jniLibsinapp/src/mainthat points to${YOUR_HOME_OPENCV_SDK}/sdk/native/libs - In
app/CMakeLists.txtchange line 9 to points to${YOUR_HOME_OPENCV_SDK}/sdk/native/jni/include - Sync gradle
- Run the application
-
The openCVLibaray343 library inside the project contains the java code of
/openCVLibrary343/src/main/java, copied from the${YOUR_HOME_OPENCV_SDK}/sdk/java/srcfolder. -
The aidl folder
/openCVLibrary343/src/main/aidlcontains the contents of${YOUR_HOME_OPENCV_SDK}/sdk/java/src/org/opencv/enginefolder, keeping the same package. -
For detection we are using a
Haar Cascadefrontal face detection inserted inres/raw/haarcascade_frontalface_alt.xml( We can find other Haar at: GitHub Link )
