public static void Dispose() { if (FaceCompare.FaceEngne != IntPtr.Zero) { FaceCompare._Dispose(FaceCompare.FaceEngne); } }
public static float MC_Compare2Image(string imgFile1, string imgFile2) { object obj = FaceCompare._obj; float result; lock (obj) { result = FaceCompare._Compare2Image(FaceCompare.FaceEngne, imgFile1, imgFile2); } return(result); }
public static void MC_CreateFaceEngne() { try { if (FaceCompare.FaceEngne == IntPtr.Zero) { FaceCompare.FaceEngne = FaceCompare._CreateFaceEngne(); } } catch (Exception message) { FaceCompare._log.Error(message); } }
public static float MC_Compare2Feature_AlphaPro(byte[] ptFeature1, byte[] ptFeature2) { float result; try { object obj = FaceCompare._obj; lock (obj) { result = FaceCompare._Compare2Feature_AlphaPro(FaceCompare.FaceEngne, ptFeature1, ptFeature2); } } catch (Exception) { result = -1f; } return(result); }
public static int MC_DetectFaces4Image(byte[] bgr24, int width, int height, int widthstep, out FaceModel[] faceModel, int MaxCount) { int result; try { object obj = FaceCompare._obj; lock (obj) { FaceModelV3[] array = new FaceModelV3[20]; int arg_32_0 = FaceCompare._FacesDetect(FaceCompare.FaceEngne, bgr24, width, height, widthstep, array, 20); faceModel = FaceUnit.FaceModelV3ToFaceModel(array); result = arg_32_0; } } catch (Exception arg_3F_0) { throw arg_3F_0; } return(result); }
public static int MC_DetectFaces4Image(Image <Bgr, byte> image, out FaceModel[] faceModel) { int result; try { object obj = FaceCompare._obj; lock (obj) { FaceModelV3[] array = new FaceModelV3[20]; int arg_4A_0 = FaceCompare._FacesDetect(FaceCompare.FaceEngne, image.Bytes, image.Width, image.Height, image.MIplImage.WidthStep, array, 20); faceModel = FaceUnit.FaceModelV3ToFaceModel(array); result = arg_4A_0; } } catch (Exception arg_57_0) { throw arg_57_0; } return(result); }
public static int MC_ExtractFeature(Image <Bgr, byte> image, ref FaceModel faceModel) { int result; try { object obj = FaceCompare._obj; lock (obj) { FaceModelV3 faceModelV = faceModel.ToFaceModelV3(); int arg_49_0 = FaceCompare._ExtractFeature(FaceCompare.FaceEngne, image.Bytes, image.Width, image.Height, image.MIplImage.Width, ref faceModelV); faceModel = FaceUnit.FaceModelV3ToFaceModel(faceModelV); result = arg_49_0; } } catch (Exception arg_56_0) { throw arg_56_0; } return(result); }
public static int DetectFaces4Image_AlphaPro(byte[] bgr24, int width, int height, int widthstep, out FaceModel[] faceModel, int maxFaceCount) { int result; try { object obj = FaceCompare._obj; lock (obj) { FaceModelV3[] array = new FaceModelV3[maxFaceCount]; int num = FaceCompare._FacesDetect_AlphaPro(FaceCompare.FaceEngne, bgr24, width, height, widthstep, array, maxFaceCount); faceModel = FaceUnit.FaceModelV3ToFaceModel(array.Take(num).ToArray <FaceModelV3>()); result = num; } } catch (Exception arg_4D_0) { throw arg_4D_0; } return(result); }