Facedemo填空代码
<!--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
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
二维码