dlib-android
https://travis-ci.org/tzutalin/dlib-android
https://github.com/tzutalin/dlib-android-app
https://github.com/tzutalin/dlib-android
安卓之Android.mk多文件以及动态库编译
https://www.cnblogs.com/ywjfx/p/10004564.html
终极Android.mk模板,遍历头文件和源文件目录
https://blog.csdn.net/as929015918/article/details/78885094
build.txt
export ANDROID_NDK_HOME=/DATA/Android/Ndk/android-ndk-r13b
export PATH=$PATH:$ANDROID_NDK_HOME Error:Could not find com.android.support:appcompat-v7:25.3..
Required by:
project :app
project :app > project :dlib Please install the Android Support Repository from the Android SDK Manager.
<a href="openAndroidSdkManager">Open Android SDK Manager</a> Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':dlib'.
> Could not resolve all dependencies for configuration ':dlib:_debugPublishCopy'.
> Could not find com.android.support:appcompat-v7:25.3..
Required by:
project :dlib
> Could not find com.android.support:support-annotations:25.3..
Required by:
project :dlib 第一次编译步骤
./envsetup
python build.py
cp -r libs/* ../dlib-android-app/dlib/src/main/jniLibs 后面的编译
python build.py
或者ndk-build -j 2
cp -r libs/* ../dlib-android-app/dlib/src/main/jniLibs libandroid_dlib.so
Readme
# dlib-android
[![Build Status](https://travis-ci.org/tzutalin/dlib-android.png)](https://travis-ci.org/tzutalin/dlib-android)
### Purpose
* Port [dlib](http://dlib.net/) to Android platform
* You can build it to dynamic or static library for Android. You can also build dlib's sample to Android executable file.
* You can refer to [dlib-android-app](https://github.com/tzutalin/dlib-android-app) which demonstrates dlib-android features
### Grab the source
$ git clone --recursive https://github.com/tzutalin/dlib-android.git
$ cd dlib-android
$ ./envsetup
### Prerequisites
* Download Android-NDK from [Android website](https://developer.android.com/ndk/downloads/index.html).
After downloading, go to the directory to which you downloaded the package to extract it
Export ANDROID_NDK_HOME in ~/.bashrc
`$ vim ~/.bashrc`
`export ANDROID_NDK_HOME=[NDK_PATH]/android-ndk-[version]`
`export PATH=$PATH:$ANDROID_NDK_HOME`
* Install Android Debug Bride (ADB). You can download it via [Android SDK Manager](https://developer.android.com/sdk/installing/index.html) or $ sudo apt-get install android-tools-adb
* Prepare an Android device for test
### Build JNI code and shared library for Android application
* You can change the compiler architecture in dlib-android/jni/Application.mk
* The way to build the shared library for Android application
```sh
$ cd [dlib-android]
$ python build.py
```
Alternative way to build native code and copy to the Android Studio's project manually:
```sh
$ cd [dlib-android]
$ ndk-build -j 2
$ cp -r libs/* androidstudio-examples/dlib-android-app/dlib/src/main/jniLibs
```
### Run Android application
* Open Android Studio's projects in androidstudio-examples/dlib-android-app to run face detection, face landmark, and so on
### Folder structure
```
├── data # Test data or the models for detection and landmarks
├── dlib # Source files of dlib. It is a submodule
├── jni # Source files of JNI codes and their make files
├── androidstudio-examples # Android Studio's projects use the shared library built by this repo
├── tools # Tools and utilities
├── third_party # Like OpenCV and [miniglog](https://github.com/tzutalin/miniglog)
├── CMakeLists.txt # Use CMake to build instead of using Android.mk
├── LICENSE
└── README.md
```
### Do you want to contribute
* If you have any improvement or you've found any bug, send a pull request with the code.
* Give me a star on this repository
* <a href='https://ko-fi.com/A4263TV2' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
### Future tasks
* Add more examples to [dlib-android-app](https://github.com/tzutalin/dlib-android-app)
CmakeList
cmake_minimum_required(VERSION 3.4.) message("Checking CMAKE_SYSTEM_NAME = '${CMAKE_SYSTEM_NAME}'")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_definitions(-DOS_OSX)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_definitions(-DOS_LINUX)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
add_definitions(-DOS_WIN)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android")
add_definitions(-DOS_ANDROID)
message("Checking CMAKE_ABI_NAME = '${CMAKE_ANDROID_ARCH_ABI}'")
else()
message("OS not detected.")
endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror") ## Define each subfolders
set(JNI_DETECTION_INCLUDE jni/jni_detections)
set(JNI_DETECTION_SRC jni/jni_detections)
set(JNI_COMMON_INCLUDE jni)
set(JNI_COMMON_SRC jni/jni_common)
set(DLIB_DIR dlib)
set(EXT_DIR third_party)
set(GLOG_INCLUDE_DIR ${EXT_DIR}/miniglog)
set(OPENCV_PREBUILT ${EXT_DIR}/OpenCV-android-sdk/sdk/native/jni) # Opencv and it will use static import
set(ANDROID_NDK_ABI_NAME ${CMAKE_ANDROID_ARCH_ABI})
include(${OPENCV_PREBUILT}/OpenCVConfig.cmake) # Include headers
include_directories(${DLIB_DIR} ${OpenCV_INCLUDE_DIRS} ${GLOG_INCLUDE_DIR} ${JNI_COMMON_INCLUDE} ${JNI_DETECTION_INCLUDE} include) add_library(android_dlib SHARED
${JNI_DETECTION_SRC}/jni_face_det.cpp
${JNI_DETECTION_SRC}/jni_imageutils.cpp
${JNI_DETECTION_SRC}/jni_pedestrian_det.cpp
${JNI_COMMON_SRC}/jni_bitmap2mat.cpp
${JNI_COMMON_SRC}/jni_fileutils.cpp
${JNI_COMMON_SRC}/jni_utils.cpp
${JNI_COMMON_SRC}/rgb2yuv.cpp
${JNI_COMMON_SRC}/yuv2rgb.cpp
${DLIB_DIR}//dlib/threads/threads_kernel_shared.cpp
${DLIB_DIR}/dlib/entropy_decoder/entropy_decoder_kernel_2.cpp
${DLIB_DIR}/dlib/base64/base64_kernel_1.cpp
${DLIB_DIR}/dlib/threads/threads_kernel_1.cpp
${DLIB_DIR}/dlib/threads/threads_kernel_2.cpp
${EXT_DIR}/miniglog/glog/logging.cc) target_link_libraries(android_dlib
android
jnigraphics
z
m
dl
log)
dlib-android的更多相关文章
- Android 中使用 dlib+opencv 实现动态人脸检测
1 概述 完成 Android 相机预览功能以后,在此基础上我使用 dlib 与 opencv 库做了一个关于人脸检测的 demo.该 demo 在相机预览过程中对人脸进行实时检测,并将检测到的人脸用 ...
- android -- 蓝牙 bluetooth (二) 打开蓝牙
4.2的蓝牙打开流程这一部分还是有些变化的,从界面上看蓝牙开关就是设置settings里那个switch开关,widget开关当然也可以,起点不同而已,后续的流程是一样的.先来看systemServe ...
- dlib VS2013 face关键点检测与对齐
http://blog.csdn.net/hust_bochu_xuchao/article/details/53906223 http://blog.csdn.net/xiamentingtao/a ...
- ZT android -- 蓝牙 bluetooth (二) 打开蓝牙
android -- 蓝牙 bluetooth (二) 打开蓝牙 分类: Android的原生应用分析 2013-05-23 23:57 4773人阅读 评论(20) 收藏 举报 androidblu ...
- 头部姿态估计 - Android
概括 通过Dlib获得当前人脸的特征点,然后通过旋转平移标准模型的特征点进行拟合,计算标准模型求得的特征点与Dlib获得的特征点之间的差,使用Ceres不断迭代优化,最终得到最佳的旋转和平移参数. A ...
- 【原】Android热更新开源项目Tinker源码解析系列之三:so热更新
本系列将从以下三个方面对Tinker进行源码解析: Android热更新开源项目Tinker源码解析系列之一:Dex热更新 Android热更新开源项目Tinker源码解析系列之二:资源文件热更新 A ...
- 配置android sdk 环境
1:下载adnroid sdk安装包 官方下载地址无法打开,没有vpn,使用下面这个地址下载,地址:http://www.android-studio.org/
- Android SwipeRefreshLayout 下拉刷新——Hi_博客 Android App 开发笔记
以前写下拉刷新 感觉好费劲,要判断ListView是否滚到顶部,还要加载头布局,还要控制 头布局的状态,等等一大堆.感觉麻烦死了.今天学习了SwipeRefreshLayout 的用法,来分享一下,有 ...
- Android Studio配置 AndroidAnnotations——Hi_博客 Android App 开发笔记
以前用Eclicps 用习惯了现在 想学学 用Android Studio 两天的钻研终于 在我电脑上装了一个Android Studio 并完成了AndroidAnnotations 的配置. An ...
- Android请求网络共通类——Hi_博客 Android App 开发笔记
今天 ,来分享一下 ,一个博客App的开发过程,以前也没开发过这种类型App 的经验,求大神们轻点喷. 首先我们要创建一个Andriod 项目 因为要从网络请求数据所以我们先来一个请求网络的共通类. ...
随机推荐
- SaltStack--使用salt-ssh
SaltStack使用salt-ssh模式 salt-ssh 介绍 参考官档 salt-ssh是 0.17.0 新引入的一个功能,不需要minion对客户端进行管理,也可以不需要master:salt ...
- 性能测试之Jmeter插件安装
使用Jmeter的实际过程中,需要使用到很多插件,比如json的插件,还有就是做websocket接口测试的时候需要下载websocket的插件,虽然官方提供了插件下载的地址,但是知道为什么每次访问的 ...
- 【Java】Java环境变量配置
一.windows系统 右键你的电脑(计算机/此电脑)打开属性->高级系统设置->环境变量,在系统变量里配置三个环境变量. 假设jdk的安装路径为C:\Program Files\Java ...
- 第3章 常用linux命令 3.5 文件压缩命令
实验六 文件及目录的压缩解压缩相关命令的使用 [实验目的] 1.掌握linux压缩文件实质 2.掌握linux中压缩及解压缩指令的用法 [实验环境] 1. 标准配置PC一台 2. linux操作系统: ...
- Java8新特性之forEach+Lambda 表达式遍历Map和List
这是Java8系列的第二篇,今天来说一下Java8中forEach的简单使用.我们使用对比的方式来看应该会看得更加清楚,更能理解: 一.遍历Map ============Java8之前的方式==== ...
- moya
https://juejin.im/post/5ac2cf34f265da23a1421483 https://juejin.im/post/5a69e9f9f265da3e290c6782
- ImageMagick 的安装及使用
一.什么是Imagemagick? ImageMagick是一款免费开源的图片编辑软件.既可以通过命令行使用,也可以通过C/C++.Perl.Java.PHP.Python或Ruby调用库编程来完成. ...
- RPC笔记搬迁
选择dubbo 启动原理 解析服务 暴露服务 引用服务 提供服务流程 结合Netty 对比 HSF https://www.cnblogs.com/lichengwei/p/5529492.h ...
- 删除ubuntu旧内核的方法
https://www.jianshu.com/p/75edb9a5fbab 磁盘满了 需要清理系统盘 1,先用uname -a 查看当前内核版本: uname -a Linux 10-9-37-13 ...
- rust crates 国内镜像加速配置
rust 很不错,但是crates 经常下载有点慢,当前阿里云还没有相关的镜像,还有科大为我们提供了一个 配置方法 添加crates 配置 $HOME/.cargo/config 目录 [regist ...