In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
< facePreviewInfoList.size(); i++) { Integer status = requestFeatureStatusMap.get(facePreviewInfoList.get(i).getTrackId()); /** * 在活体检测开启,在人脸识别状态不为成功或人脸活体状态不为处理中(ANALYZING)且不为处理完成(ALIVE、NOT_ALIVE)时重新进行活体检测 */ if (livenessDetect && (status == null || status != RequestFeatureStatus.SUCCEED)) { Integer liveness = livenessMap.get(facePreviewInfoList.get(i).getTrackId()); if (liveness == null || (liveness != LivenessInfo.ALIVE && liveness != LivenessInfo.NOT_ALIVE && liveness != RequestLivenessStatus.ANALYZING)) { livenessMap.put(facePreviewInfoList.get(i).getTrackId(), RequestLivenessStatus.ANALYZING); faceHelper.requestFaceLiveness(nv21, facePreviewInfoList.get(i).getFaceInfo(), previewSize.width, previewSize.height, FaceEngine.CP_PAF_NV21, facePreviewInfoList.get(i).getTrackId(), LivenessType.RGB); } } /** * 对于每个人脸,若状态为空或者为失败,则请求特征提取(可根据需要添加其他判断以限制特征提取次数), * 特征提取回传的人脸特征结果在{@link FaceListener#onFaceFeatureInfoGet(FaceFeature, Integer, Integer)}中回传 */ if (status == null || status == RequestFeatureStatus.TO_RETRY) { requestFeatureStatusMap.put(facePreviewInfoList.get(i).getTrackId(), RequestFeatureStatus.SEARCHING); faceHelper.requestFaceFeature(nv21, facePreviewInfoList.get(i).getFaceInfo(), previewSize.width, previewSize.height, FaceEngine.CP_PAF_NV21, facePreviewInfoList.get(i).getTrackId());// Log.i(TAG, "onPreview: fr start = " + System.currentTimeMillis() + " trackId = " + facePreviewInfoList.get(i).getTrackedFaceCount()); } } } } @Override public void onCameraClosed() { Log.i(TAG, "onCameraClosed: "); } @Override public void onCameraError(Exception e) { Log.i(TAG, "onCameraError: " + e.getMessage()); } @Override public void onCameraConfigurationChanged(int cameraID, int displayOrientation) { if (drawHelper != null) { drawHelper.setCameraDisplayOrientation(displayOrientation); } Log.i(TAG, "onCameraConfigurationChanged: " + cameraID + " " + displayOrientation); } }; cameraHelper = new CameraHelper.Builder() .previewViewSize(new Point(previewView.getMeasuredWidth(), previewView.getMeasuredHeight())) .rotation(getWindowManager().getDefaultDisplay().getRotation()) .specificCameraId(rgbCameraID != null ? rgbCameraID : Camera.CameraInfo.CAMERA_FACING_FRONT) .isMirror(false) .previewOn(previewView) .cameraListener(cameraListener) .build(); cameraHelper.init(); cameraHelper.start(); }人脸注册 private void registerFace(final byte[] nv21, final List facePreviewInfoList) { if (registerStatus == REGISTER_STATUS_READY && facePreviewInfoList != null && facePreviewInfoList.size() >0) {registerStatus = REGISTER_STATUS_PROCESSING Observable.create (new ObservableOnSubscribe () {@ Override public void subscribe (ObservableEmitter emitter) {boolean success = FaceServer.getInstance () .registerNv21 (FaceComparison_RGB.this, nv21.clone (), previewSize.width, previewSize.height, facePreviewInfoList.get (0) .getFaceInfo (), "registered" + faceHelper.getTrackedFaceCount ()) Emitter.onNext (success) ) .subscribeOn (Schedulers.computation ()) .subscrieOn (AndroidSchedulers.mainThread ()) .subscribe (new Observer () {@ Override public void onSubscribe (Disposable d)) { } / * * determine whether to register successfully * / @ Override public void onNext (Boolean success) {/ / String result = success? "register success!": "register failed!"; / / ShowToast (result); / / AlertDialog.Builder builder = new AlertDialog.Builder (FaceComparison_RGB.this); / / AlertDialog dialog = builder.create () / / View AlertDialog_View = View.inflate (FaceComparison_RGB.this,R.layout.register_result,null); / / dialog.setView (AlertDialog_View); / / dialog.show (); ShowPopWindows (success); registerStatus = REGISTER_STATUS_DONE } @ Override public void onError (Throwable e) {e.printStackTrace (); ShowToast ("register failed!"); ShowFailPopWindows (); registerStatus = REGISTER_STATUS_DONE } @ Override public void onComplete () {}});}} switch between front and rear camera public void switchCamera (View view) {if (cameraHelper! = null) {boolean success = cameraHelper.switchCamera () If (! success) {ShowToast (getString (R.string.switch_camera_failed));} else {ShowToast (getString (R.string.notice_change_detect_degree)) At this point, I believe you have a deeper understanding of "what is the method of Android developing face recognition based on ArcSoft". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.