【开源】AndroidFaceCropper
AndroidFaceCropper
- https://github.com/lafosca/AndroidFaceCropper
介绍:
使用api中自带的FaceDetector 实现人脸识别的工具库。检测一张静态图片中的人脸。运行效果:
![]()
使用说明:
实例话FaceCropper
|
1
2
|
FaceCropper mFaceCropper = new FaceCropper();mFaceCropper.getCroppedImage(source); |
其中getCroppedImage方法的参数可以是资源文件的int类型也可以是一个Bitmap
参数设置
主要有4个
setMaxFaces(int faces), 可以识别的最大人脸数.
setFaceMinSize(int faceMinSize), in pixels.
setFaceMarginPx(int faceMarginPx), in pixels, and for each side.
setEyeDistanceFactorMargin(float eyeDistanceFactorMargin), as a multiplier of the distance between the detected face eyes.
setDebug(boolean debug), to enable painting red circles over detected faces.
getFullDebugImage(Bitmap bitmap), to obtain a non-cropped image as the original, but with the detected faces painted, and the cropped area painted in green.
posted on 2015-04-15 09:35 wasdchenhao 阅读(196) 评论(0) 收藏 举报

浙公网安备 33010602011771号