Ejemplo n.º 1
0
 public bool enroll(IrisImage irisImage, string name)
 {
     try
     {
         irisImage.ProcessIris();
     }
     catch (Exception e)
     {
         //throw new Exception("Processing Error. Iris Rejected.");
     }
     try
     {
         IrisDBEntry Entry = new IrisDBEntry();
         Entry.id         = Guid.NewGuid();
         Entry.name       = name;
         Entry.InputImage = irisImage.InputImage;
         Entry.IrisCode   = irisImage.Iris.FullIrisCode;
         DB.Insert(Entry);
         return(true);
     }
     catch (Exception e)
     {
         throw new Exception("Database Error!");
     }
 }
Ejemplo n.º 2
0
 public bool enroll(IrisImage irisImage, string name)
 {
     try
     {
         irisImage.ProcessIris();
     }
     catch(Exception e)
     {
         //throw new Exception("Processing Error. Iris Rejected.");
     }
     try
     {
         IrisDBEntry Entry = new IrisDBEntry();
         Entry.id = Guid.NewGuid();
         Entry.name = name;
         Entry.InputImage = irisImage.InputImage;
         Entry.IrisCode = irisImage.Iris.FullIrisCode;
         DB.Insert(Entry);
         return true;
     }
     catch (Exception e)
     {
         throw new Exception("Database Error!");
     }
 }
Ejemplo n.º 3
0
        public bool Match(IrisImage FirstImage, IrisImage SecondImage)
        {
            Iristhread1 = new Thread(() => ThreadProcess(FirstImage));
            Iristhread1.Start();
            Iristhread2 = new Thread(() => ThreadProcess(SecondImage));
            Iristhread2.Start();

            while (Iristhread1.ThreadState != ThreadState.Stopped || Iristhread2.ThreadState != ThreadState.Stopped)
            {
                Thread.Sleep(10);
            }
            //Image<Gray, Byte> andImage = new Image<Gray, Byte>(60, 240);
            //CvInvoke.cvAnd(mask1, mask2, andImage, IntPtr.Zero);
            return(Match(FirstImage.Iris.FullIrisCode, SecondImage.Iris.FullIrisCode));
        }
Ejemplo n.º 4
0
        public IrisDBEntry Match(IrisImage FirstImage)
        {
            FirstImage.ProcessIris();
            int count = DB.Count();
            List <IrisDBEntry> Entries;

            for (int i = 0; i < count; i += Math.Min(6, count - i))
            {
                Entries = DB.Select();
                foreach (var entry in Entries)
                {
                    bool result;
                    //Thread MatchThread = new Thread(() => { result = MatchThread(FirstImage.Iris.FullIrisCode, entry.IrisCode); });
                    result = Match(FirstImage.Iris.FullIrisCode, entry.IrisCode);
                    if (result)
                    {
                        return(entry);
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 5
0
        public bool Match(IrisImage FirstImage, IrisImage SecondImage)
        {
            Iristhread1 = new Thread(() => ThreadProcess(FirstImage));
            Iristhread1.Start();
            Iristhread2 = new Thread(() => ThreadProcess(SecondImage));
            Iristhread2.Start();

            while(Iristhread1.ThreadState != ThreadState.Stopped || Iristhread2.ThreadState != ThreadState.Stopped)
            {
                Thread.Sleep(10);
            }
            //Image<Gray, Byte> andImage = new Image<Gray, Byte>(60, 240);
            //CvInvoke.cvAnd(mask1, mask2, andImage, IntPtr.Zero);
            return Match(FirstImage.Iris.FullIrisCode, SecondImage.Iris.FullIrisCode);
        }
Ejemplo n.º 6
0
 private void ThreadProcess(IrisImage iris)
 {
     iris.ProcessIris();
     Thread.CurrentThread.Abort();
 }
Ejemplo n.º 7
0
 public IrisDBEntry Match(IrisImage FirstImage)
 {
     FirstImage.ProcessIris();
     int count = DB.Count();
     List<IrisDBEntry> Entries;
     for (int i = 0; i < count; i += Math.Min(6, count - i))
     {
         Entries = DB.Select();
         foreach (var entry in Entries)
         {
             bool result;
             //Thread MatchThread = new Thread(() => { result = MatchThread(FirstImage.Iris.FullIrisCode, entry.IrisCode); });
             result = Match(FirstImage.Iris.FullIrisCode, entry.IrisCode);
             if (result)
             {
                 return entry;
             }
         }
     }
     return null;
 }
Ejemplo n.º 8
0
 private void ThreadProcess(IrisImage iris)
 {
     iris.ProcessIris();
     Thread.CurrentThread.Abort();
 }