All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.facelib.mtfsdk.BaseMtfCaptureHandler Maven / Gradle / Ivy

There is a newer version: 3.1.1
Show 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