Android face detection development-based on opencv implementation

 

 

 

 

opencv SDK download  https://opencv.org/releases/

Android Development with OpenCV  https://docs.opencv.org/3.4.10/d5/df8/tutorial_dev_with_OCV_on_Android.html

https://docs.opencv.org/3.4.10/d9/d3f/tutorial_android_dev_intro.html

opencv tutorial  https://docs.opencv.org/3.4.10/d9/df8/tutorial_root.html

Human and face detection  https://docs.opencv.org/3.4.10/d2/d64/tutorial_table_of_content_objdetect.html

Face detection and tracking effect:

 

    $ adb devices
    List of devices attached
    emulator-5554 device
    emulator-5555 device

    $ adb -s emulator-5555 install helloWorld.apk

 

Basic knowledge points to know: https://docs.opencv.org/3.4.10/d9/d3f/tutorial_android_dev_intro.html

  1. Java programming language that is the primary development technology for Android OS. Also, you can find Oracle docs on Java useful.
  2. Java Native Interface (JNI) that is a technology of running native code in Java virtual machine. Also, you can find Oracle docs on JNI useful.
  3. Android Activity and its lifecycle, that is an essential Android API class.
  4. OpenCV development will certainly require some knowledge of the Android Camera specifics.

Android NDK

To compile C++ code for Android platform you need Android Native Development Kit (NDK).

You can get the latest version of NDK from the download page. To install Android NDK just extract the archive to some folder on your computer. Here are installation instructions.

Building application native part from command line

  1. Open console and go to the root folder of an Android application

    cd <root folder of the project>/

  2. Run the following command

    <path_where_NDK_is_placed>/ndk-build

Building application native part from Eclipse (CDT Builder)

 

 

=======================================================================

Step 2: Install and configure OpenCV4Android SDK-download, import and configure opencv SDK, run samples

https://docs.opencv.org/3.4.10/da/d2a/tutorial_O4A_SDK.html

Summary: Install 2 things, (1) opencv android SDK, (2) install OpenCV Manager to the phone or emulator

You can get more information here: Android OpenCV Manager and in these slides.

 

Connect your device with adb tool from Android SDK or create an emulator with camera support.

=======================================================================

Step 3: Development of Android Development with OpenCV-call opencv library development

Overview: Write your own C++ code and call opencv, configure 2 files (1) Application.mk (2) Android.mk, a simple hellow routine

https://docs.opencv.org/3.4.10/d5/df8/tutorial_dev_with_OCV_on_Android.html

The software environment to be installed (if based on eclipse)

Method 1: Recommend Application Development with Async Initialization

Using async initialization is a recommended way for application development. It uses the OpenCV Manager to access OpenCV libraries externally installed in the target system.

方式2:Application Development with Static Initialization

According to this approach all OpenCV binaries are included into your application package. It is designed mostly for development purposes. This approach is deprecated for the production code, release package is recommended to communicate with OpenCV Manager via the async initialization described above.

 

Either use manual ndk-build invocation or setup Eclipse CDT Builder to build native JNI lib before (re)building the Java part and creating an APK.

 

The simplest OpenCV-centric application must implement OpenCV initialization, create its own view to show preview from camera and implements CvCameraViewListener2 interface to get frames from camera and process it.

 

to sum up:

Using OpenCV's Android interface, if you want to display the video input from the camera, you can use the CameraBridgeViewBase class, and then use the code in the public Mat onCameraFrame(CvCameraViewFrame inputFrame) function:

     mRgba = inputFrame.rgba();//color frame
     mGray = inputFrame.gray();// gray frame

To get each frame of the camera video, perform various processing in this function. Finally, after returning mRgba, it can be displayed on the interface
https://blog.csdn.net/wunghao8/article/details/38868281

 

 

Reference materials:

OpenCV is used in Android (opencv4 face detection source code demo analysis is very detailed!)  https://www.jianshu.com/p/4871d3dee4fa

Opencv based on android studio's development of DEMO about android face recognition (it describes in detail the steps of importing opencv sdk in the form of textures, and gives the results of recognizing face pictures)  https://blog.51cto.com/yangzheng0809/2173165

Android opencv development basis: realize human eye recognition and color change from scratch (the theory and process are very clear)  https://blog.csdn.net/qq_35029531/article/details/103193349

Android-Face detection based on OpenCV+Android https://www.cnblogs.com/numen-fan/p/10009425.html

OpenCV under Android realizes face detection now that it is so simple  https://www.jianshu.com/p/3f076d65c2e6

opencv_3.4.1_android_sdk+android studio+face detection+face recognition+eye detection demo https://download.csdn.net/download/hongtaoershi/10607396

Use OpenCV to detect faces in Android (Android studio version)  https://blog.csdn.net/qq_35952946/article/details/79036909

Three ways for Android to access the OpenCV library  https://www.cnblogs.com/xiaoxiaoqingyi/p/6676096.html

The development of opencv under the android platform [1]-android studio integrated opencv-sdk  https://www.jianshu.com/p/1dd3fc8f91b8

Android Camera dynamic face recognition + face detection is based on OpenCV (OpenCVManager is not needed) https://blog.csdn.net/qq_28931623/article/details/73528102

About armeabi, armeabi-v7a, arm64-v8a and x86 in android

https://www.jianshu.com/p/f29ad4beef59

    defaultConfig {
        ndk {
            abiFilters "armeabi-v7a"
        }
    }

Guess you like

Origin blog.csdn.net/qq_18276949/article/details/105852090