|
|
@ -19,7 +19,7 @@ namespace AksWebBrowser.Devices |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
/// <param name="code"></param> |
|
|
|
/// <param name="code"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
public static string LhtCFFace(string code,string faceA) |
|
|
|
public static string LhtCFFace(string code,string face) |
|
|
|
{ |
|
|
|
{ |
|
|
|
string result = string.Empty; |
|
|
|
string result = string.Empty; |
|
|
|
try |
|
|
|
try |
|
|
@ -46,8 +46,10 @@ namespace AksWebBrowser.Devices |
|
|
|
{ |
|
|
|
{ |
|
|
|
string time = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
string time = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
var tmpFile = "/tmp/" + time + ".jpg"; |
|
|
|
var tmpFile = "/tmp/" + time + ".jpg"; |
|
|
|
|
|
|
|
byte[] faceA = Convert.FromBase64String(face); |
|
|
|
|
|
|
|
byte[] faceB = Encoding.UTF8.GetBytes(tmpFile); |
|
|
|
|
|
|
|
status = libLhtCFs.CF_FaceCompare(faceA, faceB, 60); |
|
|
|
|
|
|
|
Log.Info("人脸比对:" + status); |
|
|
|
|
|
|
|
|
|
|
|
//停止活体检测 |
|
|
|
//停止活体检测 |
|
|
|
Task.Run(() => { libLhtCFs.CF_StopLiveDetect(); }); |
|
|
|
Task.Run(() => { libLhtCFs.CF_StopLiveDetect(); }); |
|
|
@ -144,7 +146,7 @@ namespace AksWebBrowser.Devices |
|
|
|
[DllImport("libLhtCF", EntryPoint = "CF_GetImage", SetLastError = true, CharSet = CharSet.Auto, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] |
|
|
|
[DllImport("libLhtCF", EntryPoint = "CF_GetImage", SetLastError = true, CharSet = CharSet.Auto, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] |
|
|
|
public static extern int CF_GetImage(int nImageType, [MarshalAs(UnmanagedType.LPArray)] byte[] FilePath); |
|
|
|
public static extern int CF_GetImage(int nImageType, [MarshalAs(UnmanagedType.LPArray)] byte[] FilePath); |
|
|
|
|
|
|
|
|
|
|
|
//获取采集图像 |
|
|
|
//人脸比对 |
|
|
|
[DllImport("libLhtCF", EntryPoint = "CF_GetImage", SetLastError = true, CharSet = CharSet.Auto, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] |
|
|
|
[DllImport("libLhtCF", EntryPoint = "CF_GetImage", SetLastError = true, CharSet = CharSet.Auto, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] |
|
|
|
public static extern int CF_FaceCompare(byte[] picPathA, byte[] picPathB, int score); |
|
|
|
public static extern int CF_FaceCompare(byte[] picPathA, byte[] picPathB, int score); |
|
|
|
|
|
|
|
|
|
|
|