You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.4 KiB
54 lines
2.4 KiB
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System;
|
|
|
|
namespace DemoUI.SDK
|
|
{
|
|
/// <summary>
|
|
/// 可见光单目活体接口
|
|
/// </summary>
|
|
public class CWFaceAttLiveness
|
|
{
|
|
private const string CloudWalkSDKDll = "CWFaceSDK.dll";
|
|
|
|
/// <summary>
|
|
/// 创建可见光单目活体句柄
|
|
/// </summary>
|
|
/// <param name="errCode">输出错误码</param>
|
|
/// <param name="attDetType">单目活体检测模式</param>
|
|
/// <param name="pModelPath">单目活体检测器模型文件夹路径</param>
|
|
/// <param name="pLicence">授权码</param>
|
|
/// <returns>如果创建成功,返回单目活体句柄,否则返回空</returns>
|
|
[DllImport(CloudWalkSDKDll, EntryPoint = "cwCreateAttLivenessHandle", CallingConvention = CallingConvention.Cdecl)]
|
|
public static extern IntPtr cwCreateAttLivenessHandle(out cw_attliveness_err_t errCode, cw_attliv_mode_t attDetType, string pModelPath, string pLicence);
|
|
|
|
|
|
/// <summary>
|
|
/// 释放单目活体检测句柄
|
|
/// </summary>
|
|
/// <param name="pHandle">单目活体句柄</param>
|
|
[DllImport(CloudWalkSDKDll, EntryPoint = "cwReleaseAttLivenessHandle", CallingConvention = CallingConvention.Cdecl)]
|
|
public static extern void cwReleaseAttLivenessHandle(IntPtr pHandle);
|
|
|
|
|
|
/// <summary>
|
|
/// 可见光单目活体检测接口
|
|
/// </summary>
|
|
/// <param name="pHandle">单目活体句柄</param>
|
|
/// <param name="pAttDetInfo">输入的图片及关键点等信息</param>
|
|
/// <param name="pAttackType">攻击类型</param>
|
|
/// <returns></returns>
|
|
[DllImport(CloudWalkSDKDll, EntryPoint = "cwFaceAttLivenessDet", CallingConvention = CallingConvention.Cdecl)]
|
|
public static extern cw_attliveness_err_t cwFaceAttLivenessDet(IntPtr pHandle, ref cw_att_liv_detinfo_t pAttDetInfo, out cw_attliv_det_rst_t pAttackType);
|
|
|
|
|
|
/// <summary>
|
|
/// 重置活体检测器状态
|
|
/// </summary>
|
|
/// <param name="pHandle">单目活体句柄</param>
|
|
/// <returns></returns>
|
|
[DllImport(CloudWalkSDKDll, EntryPoint = "cwFaceAttLivenessReset", CallingConvention = CallingConvention.Cdecl)]
|
|
public static extern cw_attliveness_err_t cwFaceAttLivenessReset(IntPtr pHandle);
|
|
}
|
|
}
|