示例#1
0
 public static AffdexAdapter CreateSingleton(FaceDetectorMode mode)
 {
     if (affdex == null)
     {
         affdex = new AffdexAdapter(mode);
     }
     return(affdex);
 }
示例#2
0
 public static AffdexAdapter CreateSingleton(FaceDetectorMode mode)
 {
     if (affdex == null)
     {
         affdex = new AffdexAdapter(mode);
     }
     affdex.OnFailure = null;
     affdex.OnSuccess = null;
     return(affdex);
 }
示例#3
0
        public PhotoHandler()
        {
            detecters = new IDetectAdapter[] {
                AffdexAdapter.CreateSingleton(FaceDetectorMode.LARGE_FACES),
                new MSAdapter()
            };

            for (int i = 0; i < detecters.Length; i++)
            {
                detecters[i].OnSuccess += Det_OnSuccess;
            }

            for (int i = 0; i < detecters.Length - 1; i++)
            {
                int next = i + 1;
                detecters[i].OnFailure += (s, e) => detecters[next].Process(imageToProcess);
            }

            detecters.Last().OnFailure += Det_OnFailure;
        }