美文网首页开源库挖掘&推荐
安卓脸部识别开源库 | FaceDetector

安卓脸部识别开源库 | FaceDetector

作者: 5afd372c86ba | 来源:发表于2017-10-20 10:16 被阅读45次
名称 FaceDetector
语言 Android
平台 GitHub
作者 Fotoapparat
链接 点此进入
备注 更多精彩开源库推荐请访问明灯小站

该开源库能让你在Android上实现通过手机相机实时识别人的面部,其特点有:
简单易用;
多重相机开源库都可以使用该框架做面部识别;
使用C++编写核心库,效率高;
效果

screenshot.gif
使用方法
  1. 添加依赖
repositories {
    maven {
        url  "http://dl.bintray.com/fotoapparat/fotoapparat"
    }
}

compile 'io.fotoapparat:facedetector:1.0.0'

// If you are using Fotoapparat add this one as well
compile 'io.fotoapparat.fotoapparat:library:1.2.0' // or later version
  1. 编写布局
<io.fotoapparat.facedetector.view.CameraOverlayLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <!-- 配置可以根据你的需求调整,但是CameraView必须在 CameraOverlayLayout 布局中 -->
    <io.fotoapparat.view.CameraView
        android:id="@+id/cameraView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <!-- 这个View将显示面部识别的框框 -->
    <io.fotoapparat.facedetector.view.RectanglesView
        android:id="@+id/rectanglesView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:rectanglesColor="@color/colorAccent"
        app:rectanglesStrokeWidth="2dp"/>

</io.fotoapparat.facedetector.view.CameraOverlayLayout>
  1. Java代码中创建FaceDetectorProcessor
FaceDetectorProcessor processor = FaceDetectorProcessor.with(this)
    .listener(faces -> {
        rectanglesView.setRectangles(faces);  // (Optional) Show detected faces on the view.

        // ... or do whatever you want with the result
    })
    .build()
  1. 添加处理器到Fotoapparat
Fotoapparat.with(this)
    .into(cameraView)
    // the rest of configuration
    .frameProcessor(processor)
    .build()

更多使用方法可以参考其GitHub。

相关文章

  • 安卓脸部识别开源库 | FaceDetector

    该开源库能让你在Android上实现通过手机相机实时识别人的面部,其特点有:简单易用;多重相机开源库都可以使用该框...

  • 源码对比分析

    1,安卓下拉刷新开源库对比 讲解滑动事件的冲突安卓下拉刷新开源库对比

  • 指纹、VR、AR

    ------指纹------优雅实现Android指纹验证安卓指纹识别库(安卓官方 + 三星 SDK + 魅族 S...

  • Andoird控件收集

    Android UI相关开源项目库汇总OpenDigg 抽屉菜单MaterialDrawer ★7337 - 安卓...

  • 安卓常用开源库

    该文章根据分类整理了较完善的github上开源库,以供平时开发根据自己需要直接找到使用,并且在平时开发和翻阅资料时...

  • 安卓人脸检测之FaceDetector

    最近看到一个APP的头像上传时,如果你设置的图片里面没有人脸,或者有两张以及以上人脸的时候,会提示你图片不符合规范...

  • 火遍安卓的下拉刷新框架 SmartRefresh 出 IOS 版

    安卓那边的开源库 SmartRefresh[https://github.com/scwang90/SmartRe...

  • day 1 day 2

    什么是安卓 由Google公司推出,基于Linux开源的操作系统 安卓框架 底层 linux内核 第二层 核心库(...

  • Android值得收藏的自定义控件大全

    很值得收藏的安卓开源控件库 awesome-android-ui Github优秀Android开源项目,值得引用与学习

  • Android之xCrash介绍

    xCrash xCrash是爱奇艺开源的在android平台上面捕获异常的开源库。 xCrash能为安卓 APP提...

网友评论

    本文标题:安卓脸部识别开源库 | FaceDetector

    本文链接:https://www.haomeiwen.com/subject/dkvmuxtx.html