<!--todo step 1: add authorization of camera --> <uses-feature android:name="android.hardware.camera" /> <uses-permission android:name="android.permission.CAMERA"/>
// todo step 2: add on-device face analyzer
MLFaceAnalyzerSetting setting = new MLFaceAnalyzerSetting.Factory()
.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES)
.setPerformanceType(MLFaceAnalyzerSetting.TYPE_SPEED)
.allowTracing()
.create();
this.analyzer = MLAnalyzerFactory.getInstance().getFaceAnalyzer(setting);
// finish
// todo step 3: add on-device lens engine
this.mLensEngine = new LensEngine.Creator(context, this.analyzer)
.setLensType(this.lensType)
.applyDisplayDimension(1600, 1024)
.applyFps(25.0f)
.enableAutomaticFocus(true)
.create();
// finish
// todo step 4: add on-device face graphic MLFaceGraphic graphic = new MLFaceGraphic(this.mGraphicOverlay, faceSparseArray.valueAt(i)); this.mGraphicOverlay.add(graphic); // finish
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/392164.html
標籤:其他
