android人脸检测开发——基于opencv实现

opencv SDK下载 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教程 https://docs.opencv.org/3.4.10/d9/df8/tutorial_root.html

人及人脸检测 https://docs.opencv.org/3.4.10/d2/d64/tutorial_table_of_content_objdetect.html

人脸检测及跟踪效果:

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

    $ adb -s emulator-5555 install helloWorld.apk

需要了解的基本知识点: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)

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

第2步:安装配置篇 OpenCV4Android SDK—— 下载、导入及配置opencv SDK,运行samples

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

概括:安装2个东西,(1)opencv android SDK,(2)OpenCV Manager 安装到手机或模拟器上

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.

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

第3步:开发篇 Android Development with OpenCV——调用opencv库开发

概况:编写自己的C++代码并调用opencv,配置2个文件(1)Application.mk(2)Android.mk,一个简单的hellow例程

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

需要安装的软件环境(如果基于eclipse)

方式1:推荐 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.

总结:

使用OpenCV的Android接口,要想显示从摄像头输入的视频,可以使用CameraBridgeViewBase类,然后在public Mat onCameraFrame(CvCameraViewFrame inputFrame) 函数中使用代码:

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

来得到摄像头视频的每一个frame,在这个函数中进行各种处理。最后return mRgba后就可以在界面上显示了
https://blog.csdn.net/wunghao8/article/details/38868281

参考资料:

Android中使用OpenCV(opencv4人脸检测源码demo分析的很细致!) https://www.jianshu.com/p/4871d3dee4fa

基于android studio开发的 opencv关于android人脸识别的DEMO(以贴图方式详细讲述了导入opencv sdk步骤,并给出了识别人脸图片的结果) https://blog.51cto.com/yangzheng0809/2173165

android opencv开发基础:从零开始实现人眼识别与变色(理论方面及流程讲的很清楚) https://blog.csdn.net/qq_35029531/article/details/103193349

Android—基于OpenCV+Android实现人脸检测https://www.cnblogs.com/numen-fan/p/10009425.html

android下OpenCV实现人脸检测既然如此简单 https://www.jianshu.com/p/3f076d65c2e6

opencv_3.4.1_android_sdk+android studio+人脸检测+人脸识别+人眼检测demohttps://download.csdn.net/download/hongtaoershi/10607396

Android中使用OpenCV检测人脸(Android studio版) https://blog.csdn.net/qq_35952946/article/details/79036909

Android 接入 OpenCV库的三种方式 https://www.cnblogs.com/xiaoxiaoqingyi/p/6676096.html

opencv在android平台下的开发【1】-android studio集成opencv-sdk https://www.jianshu.com/p/1dd3fc8f91b8

Android Camera动态人脸识别+人脸检测基于OpenCV(无需OpenCVManager)https://blog.csdn.net/qq_28931623/article/details/73528102

关于android中的armeabi、armeabi-v7a、arm64-v8a及x86等

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

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

猜你喜欢

转载自blog.csdn.net/qq_18276949/article/details/105852090