net.facelib.mtfsdk.BaseMtfCaptureHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mtfsdk-android-common Show documentation
Show all versions of mtfsdk-android-common Show documentation
mtfsdk common(detection included) for android
The newest version!
package net.facelib.mtfsdk;
import net.gdface.sdk.SDKLog;
import com.gitee.l0km.ximage.MatType;
import com.gitee.l0km.ximage.android.ImageUtil;
import net.facelib.jni.BridgeLog;
import net.facelib.jni.BridgePool;
import net.facelib.sdk.FaceCapturer;
import net.facelib.sdk.ImageSupport;
/**
* V2人脸视频检测实现(android平台)
* @author guyadong
*
*/
public abstract class BaseMtfCaptureHandler extends FaceCapturer{
/**
* 人脸特性比对相似度阀值默认值
*/
protected final double defaultSimilarityThreshold = 0.65;
public BaseMtfCaptureHandler() {
}
@Override
protected double getDefaultSimilarityThreshold() {
return defaultSimilarityThreshold;
}
@Override
protected byte[] matToJpeg(MatType matType, byte[] matData, int width, int height) {
byte[] nv21 = ImageSupport.toNV21(matType, matData, width, height);
return ImageUtil.nv21ToJPEG(nv21, width, height);
}
@Override
public FaceCapturer enableDebugLog(){
/** 开启SDK层日志输出 */
SDKLog.SDK_LOGGER.enableConsoleLog();
/** 开启算法模块层日志输出 */
BridgeLog.BRIDEG_LOGGER.enableConsoleLog();
return this;
}
@Override
protected void doReleaseSdkModules() {
BridgePool.clearAllBridgePools(2000);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy