In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how Android based on ArcSoft to achieve face recognition, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
1. Create your own application in Hongrou's developer center and record APP_ID and SDK_KEY, which will be used later. After you create it, you can download SDK.
2. After downloading, you can refer to and learn according to the development instructions and code in the SDK package. The following is a screenshot of the SDK package structure in the development documentation.
0) {registerStatus = REGISTER_STATUS_PROCESSING Observable.create (new ObservableOnSubscribe () {@ Override public void subscribe (ObservableEmitter emitter) {boolean success = FaceServer.getInstance () .registerNv21 (FaceRegisterAndRecognise.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)) { } @ Override public void onNext (Boolean success) {String result = success? "register success!": "register failed!"; showToast (result); registerStatus = REGISTER_STATUS_DONE;} @ Override public void onError (Throwable e) {e.printStackTrace () ShowToast ("register failed!"); registerStatus = REGISTER_STATUS_DONE;} @ Override public void onComplete () {}};}}
13. The management interface of face database.
Public class FaceLibs extends BaseActivity {private ExecutorService executorService; private TextView textView; private TextView tvNotificationRegisterResult; ProgressDialog progressDialog = null; private static final int ACTION_REQUEST_PERMISSIONS = 0x001; private static String [] NEEDED_PERMISSIONS = new String [] {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}; @ Override protected void onCreate (Bundle savedInstanceState) {super.onCreate (savedInstanceState) SetContentView (R.layout.activity_face_libs); getWindow (). AddFlags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); executorService = Executors.newSingleThreadExecutor (); tvNotificationRegisterResult = findViewById (R.id.notification_register_result); progressDialog = new ProgressDialog (this); int faceLibNum = FaceServer.getInstance (). GetFaceNumber (this); textView = findViewById (R.id.number); textView.setText (faceLibNum + ") FaceServer.getInstance () .init (this);} @ Override protected void onDestroy () {if (executorService! = null & &! executorService.isShutdown ()) {executorService.shutdownNow ();} if (progressDialog! = null & & progressDialog.isShowing ()) {progressDialog.dismiss ();} FaceServer.getInstance () .unInit (); super.onDestroy () } @ Override void afterRequestPermission (int requestCode, boolean isAllGranted) {} public void clearFaces (View view) {int faceNum = FaceServer.getInstance () .getFaceNumber (this); if (faceNum = = 0) {showToast ("face database is empty!") ;} else {AlertDialog dialog = new AlertDialog.Builder (this) .setTitle ("Notification") .setMessage ("sure you want to delete" + faceNum + "personal face?") .setPositiveButton ("OK", new DialogInterface.OnClickListener () {@ Override public void onClick (DialogInterface dialog, int which) {int deleteCount = FaceServer.getInstance () .clearAllFaces (FaceLibs.this); showToast (deleteCount + "personal face deleted!") ; textView.setText ("0");}) .setNegativeButton ("cancel", null) .create (); dialog.show ();}
14. The above is a general introduction, and there are still some minor details to be practiced by comrades. Let's take a look at the effect of the implementation.
Main interface:
Successfully registered and identified:
Identify that it is not alive by cell phone photos:
Clean up the face database:
The above is all the contents of the article "how to realize face recognition based on ArcSoft in Android". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.