int IFaceCompare.DetectFaces4Image(byte[] bgr24, int width, int height, int widthstep, out FaceModel[] faceModel) { int result; try { object obj = FaceCompareV2._obj; lock (obj) { FaceModelV2[] array = new FaceModelV2[20]; int num = FaceCompareV2._FacesDetect(FaceCompareV2._faceEngne, bgr24, width, height, widthstep, array, 20); if (num > 0) { for (int i = 0; i < num; i++) { FaceCompareV2._ExtractFeature(FaceCompareV2._faceEngne, bgr24, width, height, widthstep, ref array[i]); } } faceModel = FaceUnit.FaceModelV2ToFaceModel(array.Take(num).ToArray <FaceModelV2>()); result = num; } } catch (Exception arg_7A_0) { throw arg_7A_0; } return(result); }
int IFaceCompare.ExtractFeature(byte[] bgr24, int width, int height, int widthstep, ref FaceModel faceModel) { int result; try { object obj = FaceCompareV2._obj; lock (obj) { FaceModelV2 faceModelV = faceModel.ToFaceModelV2(); int arg_33_0 = FaceCompareV2._ExtractFeature(FaceCompareV2._faceEngne, bgr24, width, height, widthstep, ref faceModelV); faceModel = FaceUnit.FaceModelV2ToFaceModel(faceModelV); result = arg_33_0; } } catch (Exception) { throw; } return(result); }