コード例 #1
0
        int IFaceCompare.ExtractFeature(byte[] bgr24, int width, int height, int widthstep, ref FaceModel faceModel)
        {
            int result;

            try
            {
                object obj = FaceComparePro._obj;
                lock (obj)
                {
                    FaceModelV3[] array = new FaceModelV3[1];
                    int           num   = FaceComparePro._FacesDetect_AlphaPro(FaceComparePro.FaceEngne, bgr24, width, height, widthstep, array, 1);
                    if (num > 0)
                    {
                        faceModel = FaceUnit.FaceModelV3ToFaceModel(array.FirstOrDefault <FaceModelV3>());
                    }
                    else
                    {
                        faceModel = new FaceModel();
                        num       = -1;
                    }
                    result = num;
                }
            }
            catch (Exception arg_56_0)
            {
                throw arg_56_0;
            }
            return(result);
        }
コード例 #2
0
 public void CreateFaceEngne()
 {
     try
     {
         if (FaceComparePro.FaceEngne == IntPtr.Zero)
         {
             FaceComparePro.FaceEngne = FaceComparePro._CreateFaceEngne();
             Console.WriteLine(FaceComparePro.FaceEngne);
         }
     }
     catch (Exception message)
     {
         this._log.Error(message);
     }
 }
コード例 #3
0
        public float Compare2Feature(byte[] ptFeature1, byte[] ptFeature2)
        {
            float result;

            try
            {
                object obj = FaceComparePro._obj;
                lock (obj)
                {
                    result = FaceComparePro._Compare2Feature_AlphaPro(FaceComparePro.FaceEngne, ptFeature1, ptFeature2);
                }
            }
            catch (Exception)
            {
                result = -1f;
            }
            return(result);
        }
コード例 #4
0
        int IFaceCompare.DetectFaces4Image_only(byte[] bgr24, int width, int height, int widthstep, out FaceModel[] faceModel, int maxFaceCount)
        {
            int result;

            try
            {
                object obj = FaceComparePro._obj;
                lock (obj)
                {
                    FaceModelV3[] array = new FaceModelV3[maxFaceCount];
                    int           num   = FaceComparePro._FacesDetect_AlphaPro(FaceComparePro.FaceEngne, bgr24, width, height, widthstep, array, maxFaceCount);
                    faceModel = FaceUnit.FaceModelV3ToFaceModel(array.Take(num).ToArray <FaceModelV3>());
                    result    = num;
                }
            }
            catch (Exception arg_4E_0)
            {
                throw arg_4E_0;
            }
            return(result);
        }
コード例 #5
0
        public static IFaceCompare Create(FaceCompareType faceCompareType)
        {
            IFaceCompare result = null;

            switch (faceCompareType)
            {
            case FaceCompareType.FaceCompareBase:
                result = new FaceCompareBase();
                break;

            case FaceCompareType.FaceComparePro:
                result = new FaceComparePro();
                break;

            case FaceCompareType.FaceCompareV4:
                result = new FaceCompareV4();
                break;

            case FaceCompareType.FaceCompareV2:
                result = new FaceCompareV2();
                break;
            }
            return(result);
        }
コード例 #6
0
 public long GetDongerSerial()
 {
     return(FaceComparePro._GetDongerSerial());
 }
コード例 #7
0
 public void Dispose()
 {
     FaceComparePro._Dispose(FaceComparePro.FaceEngne);
 }