This application (Android based) allow to identify somebody through camera
This Android Studio project utilizes OpenCV 4.9.0 for facial recognition with PCA through a dual-fragment system: Camera and Gallery. Targeting rapid deployment, it integrates NDK (26.1.10909125) for robust development, supports API levels 28 to 34, and maintains compatibility with JavaVersion.VERSION_17
.
This Android application is a streamlined foundation for integrating OpenCV 4.9.0, as well as other 4.x.y versions, within the Android Studio environment, augmented with the power of the Native Development Kit (NDK). The NDK support empowers developers to craft sophisticated OpenCV image processing pipelines in C++ and seamlessly invoke this native codebase from within the Android Java ecosystem via the Java Native Interface (JNI).
- Dual Fragment System: Camera and Gallery fragments for a seamless user experience.
- PCA Recognition: Utilizes a five-component PCA for accurate facial recognition.
- Smooth Navigation: Drawer layout for easy toggling between Camera and Gallery.
- Gallery Preview: Review selected training images before processing.
- Real-Time Recognition: Post-training, the system can immediately recognize faces.
- Training Reset: Easily restart PCA training within the Gallery.
- JNI Troubleshooting: Solutions for common JNI issues are included.
- Android Studio with CMake and NDK installed.
- OpenCV Android SDK (version 4.9.0 recommended).
- Android device or emulator (API level 28+ recommended).
- Clone and Sync: Clone this repo and sync with Gradle.
- OpenCV Configuration: Validate OpenCV SDK path in
settings.gradle
. - Build and Deploy: Build the project and run it on your device or emulator.
- Go to Gallery Fragment.
- Select images for training and press "Process".
- Wait for the Toast indicating training completion.
- Switch to Camera Fragment to experience facial recognition.
-
Clone this repository as an Android Studio project
-
Shared objects install OpenCV Android release :
- Copy from
/opencv/native
to/sdk/native
. It will be necesary to build the application.
- Copy from
-
Sync Gradle and run the application on your device or AVD
CMake Error at /opencv/native/jni/abi-arm64-v8a/OpenCVModules.cmake:238 (message):
The imported target "libcpufeatures" references the file
"/sdk/native/3rdparty/libs/arm64-v8a/libcpufeatures.a"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* You have changed OpenCV implement project statment.
So, in order to fix it you need to copy /opencv/native...
to /sdk/native
. Dont delete anything.
Contributions are welcome. Please refer to CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Gratitude to the OpenCV community for their extensive resources and support.