android人脸识别项目FaceDetectionListener--------研究之三
2015-04-09 14:55
459 查看
通过不断是查找资料发现摄像头预览情况下可以使用FaceDetectionListener,FaceDetector实现方式对于图片没有什么问题,但是在摄像头预览情况下反应有些迟钝,我对此进行了修改,重写FaceDetectionListener,实现onFaceDetection方法,通过Message回传了Face[ ].
public class MyFaceDetectionListener implements FaceDetectionListener{ private Context context; private Handler handler; public MyFaceDetectionListener(Context context,Handler handler){ this.context = context; this.handler = handler; } @Override public void onFaceDetection(Face[] mFaces, Camera arg1) { // TODO Auto-generated method stub if(mFaces != null){ Message msg = new Message(); msg.what = SystemCode.CODE_MSG_FACE_DETECTION_POSITIVE; msg.obj = mFaces; handler.sendMessage(msg); }else{ handler.obtainMessage(SystemCode.CODE_MSG_FACE_DETECTION_NEGATIVE).sendToTarget(); } } }camera需要调用如下监听,getMaxNumDetectedFaces()为了检查改设备是否支持人脸识别框,startFaceDetection必须在startPreview之后调用
camera.setFaceDetectionListener(new MyFaceDetectionListener(getApplicationContext(),handler)); <span style="white-space:pre"> </span>if (parameters.getMaxNumDetectedFaces() > 0){ <span style="white-space:pre"> </span>camera.startFaceDetection(); }剩下的一样就是通过mFindFaceView.drawRects(mFaces);完成人脸识别框的绘制。
相关文章推荐
- android人脸识别项目SOAP--------研究之一
- android人脸识别项目FaceDetector--------研究之二
- 人脸识别技术大总结——Face Detection & Alignment
- 人脸识别技术大总结1——Face Detection & Alignment
- android OpenCV研究之动态人脸识别
- 人脸识别技术大总结—Face Detection & Alignment
- android 通过Camera和Surfaceview实现照相 图片预览 保存图片到本地 手动聚焦 FaceDetectionListener实现人脸识别
- 人脸识别技术大总结1——Face Detection & Alignment
- 人脸识别技术大总结(1):Face Detection & Alignment
- 人脸识别技术大总结(1)——Face Detection & Alignment
- 人脸识别技术大总结——Face Detection & Alignment
- Android使用Face++架构包实现人脸识别
- Investigation of uncooled infrared imagery for face recognition(用于人脸识别的非制冷红外成像研究)
- android 结合 opencv项目(NDK、OpenCV、android,官方Demo人脸识别)
- [置顶] Android移动开发-在Android项目里集成face++人脸识别的实现
- 人脸识别技术大总结(1)——Face Detection & Alignment
- 人脸识别技术大总结——Face Detection & Alignment
- 转:人脸识别技术大总结1——Face Detection & Alignment
- 人脸识别技术大总结(1)——Face Detection & Alignment
- Android安卓人脸考勤人脸识别项目源码