Android example
Bestshot example project that demonstrates LUNA SDK capabilities on Android platform.
What it does
This example demonstrates how to work with various Luna SDK components such as :
- Face detection;
- Image warping;
- Image quality estimation;
- Best shot (choosing the face best shot on a video frame sequence) via Track Engine SDK;
- Face descriptor extraction(available only with Luna SDK Complete edition);
- Face descriptors matching (available only with Luna SDK Complete edition);
- User interaction, e.g. ask a user to blink multiple times before proceeding image processing pipeline.
It also demonstrates how to use C++ code and libraries with Java language.
Prerequisites
Besides system Android SDK/NDK lib, there are four dependencies:
- libflower.so
- libFaceEngineSDK.so
- libTrackEngineSDK.so
Project is distributed as part of FaceEngine SDK and all of listed dependencies are included into distribution for Android platform.
We expect that you have basic Android and NDK development experience, so we won't cover topics unrelated to this example.
This example assumes that you have read the FaceEngine Handbook already
(or at least have it somewhere nearby for reference) and know some core concepts,
like memory management, object ownership and life-time control. This sample will not explain
these aspects in detail.
How to run
If you want to build and run ONLINE version of demo project you need to do the following:
- Open demo project in Android Studio and change build variant from default one (which is offlineDebug) to OnlineDebug.
You can change build variant in Android Studio by clicking at the bottom left icon called "Build Variants".
- After project configuring is done by Gradle you can run demo project on Android device.
If you want to build and run OFFLINE version of demo project you need to do the following:
- Make sure you are using Luna SDK complete library edition because only this edition supports
face descriptor extraction and matching.
- Open demo project in Android Studio and build the project by clicking Build/MakeProject.
- After project configuring is done by Gradle you can run demo project on Android device.
Known issues
- There is a known bug with cmake version 3.10.2 provided by android studio by default which fails to resolve paths to FaceEngineSDK libraries correctly while building example project. To resolve this issue please downgrade cmake to version 3.6.4 via android SDK manager.