using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using System; namespace DemoUI.SDK { /// /// 可见光单目活体接口 /// public class CWFaceAttLiveness { private const string CloudWalkSDKDll = "CWFaceSDK.dll"; /// /// 创建可见光单目活体句柄 /// /// 输出错误码 /// 单目活体检测模式 /// 单目活体检测器模型文件夹路径 /// 授权码 /// 如果创建成功,返回单目活体句柄,否则返回空 [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); /// /// 释放单目活体检测句柄 /// /// 单目活体句柄 [DllImport(CloudWalkSDKDll, EntryPoint = "cwReleaseAttLivenessHandle", CallingConvention = CallingConvention.Cdecl)] public static extern void cwReleaseAttLivenessHandle(IntPtr pHandle); /// /// 可见光单目活体检测接口 /// /// 单目活体句柄 /// 输入的图片及关键点等信息 /// 攻击类型 /// [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); /// /// 重置活体检测器状态 /// /// 单目活体句柄 /// [DllImport(CloudWalkSDKDll, EntryPoint = "cwFaceAttLivenessReset", CallingConvention = CallingConvention.Cdecl)] public static extern cw_attliveness_err_t cwFaceAttLivenessReset(IntPtr pHandle); } }