Beispiel #1
1
        public static bool Verify(DPFP.Sample _sample, DPFP.Template _template)
        {
            try
            {
                bool _result = false;
                DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();
                DPFP.FeatureSet features = zsi.dtrs.Util.ExtractFeatures(_sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    // Compare the feature set with our template
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, _template, ref result);

                    if (result.Verified)
                    {
                        _result = true;
                    }
                    else
                    {
                        _result = false;
                    }
                }
                return(_result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
 {
     DPFP.Verification.Verification        ver = new DPFP.Verification.Verification();
     DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();
     // Compare feature set with all stored templates.
     foreach (DPFP.Template template in Data.Templates)
     {
         // Get template from storage.
         if (template != null)
         {
             // Compare feature set with particular template.
             ver.Verify(FeatureSet, template, ref res);
             Data.IsFeatureSetMatched = res.Verified;
             Data.FalseAcceptRate     = res.FARAchieved;
             if (res.Verified)
             {
                 break; // success
             }
         }
     }
     if (!res.Verified)
     {
         Status = DPFP.Gui.EventHandlerStatus.Failure;
     }
     Data.Update();
 }
Beispiel #3
0
        public bool ProcesarChecado(DPFP.Sample Sample, DPFP.Template templateGuardado, frmChecarEntradaSalida FrmChecar)
        {
            try
            {
                DrawPictureChecar(ConvertSampleToBitmapLogin(Sample), FrmChecar);
                DPFP.FeatureSet features = ExtractFeaturesChecar(Sample, DPFP.Processing.DataPurpose.Verification);
                if (features != null)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, templateGuardado, ref result);

                    if (result.Verified)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                LogError.AddExcFileTxt(ex, "LectorHuella ~ ProcesarChecado");
                return(false);
            }
        }
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            MakeReport("fingerprint captured.");
            SetPrompt("Scan fingerprint again");
            //Process(Sample);
            try
            {
                Connection con = new Connection();
                con.Connect();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "select RESIDENT_FINGERPRINT, RESIDENT.RESIDENT_ID,PROGRAM.PROGRAM_ID,LIST.RESIDENT_ID,LIST.PROGRAM_ID FROM RESIDENT LEFT JOIN LIST ON RESIDENT.RESIDENT_ID = LIST.RESIDENT_ID LEFT JOIN PROGRAM ON PROGRAM.PROGRAM_ID = RESIDENT.RESIDENT_ID WHERE LIST.PROGRAM_ID ='" + label2.Text + "' AND LIST_VERIFICATION IS NULL";
                cmd.Connection  = Connection.con;
                SqlDataAdapter sd = new SqlDataAdapter(cmd);
                DataTable      dt = new DataTable();
                sd.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    byte[] _img = (byte[])dr["resident_fingerprint"];
                    string id   = dr["RESIDENT_ID"].ToString();
                    string pid  = dr["PROGRAM_ID"].ToString();



                    MemoryStream ms = new MemoryStream(_img);

                    DPFP.Template Template = new DPFP.Template();
                    Template.DeSerialize(ms);
                    DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();

                    Process(Sample);

                    DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
                    if (features != null)
                    {
                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, Template, ref result);
                        UpdateStatus(result.FARAchieved);
                        if (result.Verified)
                        {
                            MessageBox.Show("Verified!!!");
                            SqlCommand cmds = new SqlCommand();
                            cmds.CommandText = "UPDATE LIST SET LIST_VERIFICATION ='True' WHERE LIST.RESIDENT_ID = '" + id.ToString() + "' AND LIST.PROGRAM_ID = '" + label2.Text + "'";
                            cmds.Connection  = Connection.con;
                            SqlDataReader dar = cmds.ExecuteReader();
                        }
                        else
                        {
                            MakeReport("Not registered as a resident!");
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch
            {
            }
        }
Beispiel #5
0
        void VerificationControl_OnComplete(object control, FeatureSet featureSet, ref DPFP.Gui.EventHandlerStatus eventHandlerStatus)
        {
            // Verify Here
            var ver             = new DPFP.Verification.Verification();
            var res             = new DPFP.Verification.Verification.Result();
            var fingerTemplates = new BeneficiaryRepository().GetFingerTemplates();

            // Compare feature set with all stored templates.


            foreach (var template in fingerTemplates)
            {
                // Get template from storage.
                if (template != null)
                {
                    // Compare feature set with particular template.
                    ver.Verify(featureSet, template, ref res);
                    //_data.IsFeatureSetMatched = res.Verified;
                    //_data.FalseAcceptRate = res.FARAchieved;
                    if (res.Verified)
                    {
                        break; // success
                    }
                }
            }

            if (!res.Verified)
            {
                eventHandlerStatus = DPFP.Gui.EventHandlerStatus.Failure;
            }

            //_data.Update();
        }
        private void verify(DPFP.Sample Sample)
        {
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            byte[] fpbyte = getFTemplate();
            if (fpbyte != null)
            {
                Stream        stream = new MemoryStream(fpbyte);
                DPFP.Template tmpObj = new DPFP.Template(stream);


                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                // Compare the feature set with our template
                Verificator.Verify(features, tmpObj, ref result);
                if (result.Verified)
                {
                    MessageBox.Show("The fingerprint was VERIFIED.");
                    client.Send("desktop-verify-verified");
                }
                else
                {
                    MessageBox.Show("The fingerprint was NOT VERIFIED.");
                    client.Send("desktop-verify-notverified");
                }
            }


            hideForm();
        }
Beispiel #7
0
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(Sample);

            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                Verificator.Verify(features, Template, ref result);
                UpdateStatus(result.FARAchieved);
                if (result.Verified)
                {
                    MakeReport("Lectura verificada.");
                }
                else
                {
                    MakeReport("Lectura no verificada.");
                }
            }
        }
Beispiel #8
0
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(Sample);

            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();

                DPFP.Template template = new DPFP.Template();
                Stream        stream;

                foreach (var emp in contexto.Empleadoes)
                {
                    stream   = new MemoryStream(emp.Huella);
                    template = new DPFP.Template(stream);

                    Verificator.Verify(features, template, ref result);
                    UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        MakeReport("The fingerprint was VERIFIED. " + emp.Nombre);
                        break;
                    }
                }
            }
        }
        public void OnComplete(object Capture, string ReaderSerialNumber, Sample Sample)
        {
            SetImagePawprint(Sample);
            DPFP.FeatureSet featureSet = CreateFeatureSet(Sample, DPFP.Processing.DataPurpose.Verification);

            if (featureSet != null)
            {
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();

                List <User> ListUser = mySqlAdapter.GetAllUsers();

                foreach (User user in ListUser)
                {
                    MemoryStream ms = new MemoryStream(user.Pawprint);
                    template.DeSerialize(ms.ToArray());

                    verification.Verify(featureSet, template, ref result);

                    if (result.Verified)
                    {
                        display("Hola: " + user.Name);
                        break;
                    }
                    else
                    {
                        display("No match found");
                    }
                }
            }
            else
            {
                MessageBox.Show("Nothing found here");
            }
        }
        public static bool Verify(DPFP.Sample _sample, DPFP.Template _template)
        {
            try
            {
                bool _result = false;
                DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();
                DPFP.FeatureSet features = zsi.dtrs.Util.ExtractFeatures(_sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    // Compare the feature set with our template
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, _template, ref result);

                    if (result.Verified)
                        _result = true;
                    else
                        _result = false;

                }
                return _result;
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Beispiel #11
0
        protected void Compare(Template template, Sample sample)
        {
            try
            {
                // Process the sample and create a feature set for the enrollment purpose.
                //MemoryStream ms = new MemoryStream(Funciones.ImageToByteArray(this.picHuella.Image));
                //DPFP.Sample sample = new DPFP.Sample(ms);
                DPFP.FeatureSet features = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    // Compare the feature set with our template
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, template, ref result);
                    //UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        MessageBox.Show(this, "El usuario coincide con el existente!", "Validador Huella", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        MakeReport("El usuario coincide con el existente!");
                    }
                    else
                    {
                        MessageBox.Show(this, "El usuario No coincide con el existente!", "Validador Huella", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        MakeReport("El usuario No coincide con el existente!.");
                    }
                }
            }
            catch (Exception ex)
            {
                MakeReport(ex.Message);
            }
        }
        protected void Process(DPFP.Sample Sample)
        {
            DrawPicture(ConvertSampleToBitmap(Sample));
            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our tamplete
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                verifor.Verify(features, tamplete, ref result);
                if (result.Verified)
                {
                    MakeReport("The fingerprint was VERIFIED.");
                    displayData(files[fileCounter - 1]);
                    fileCounter = 0;
                    isVarifed   = true;
                }
                else
                {
                    MakeReport("The fingerprint was NOT VERIFIED.");
                    Stop();
                    loadNextFile();
                    Init();
                    Start();
                }
            }
        }
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            //Process(Sample);
            try
            {
                Connection con = new Connection();
                con.Connect();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = " select * from resident ";
                cmd.Connection  = Connection.con;
                SqlDataAdapter sd = new SqlDataAdapter(cmd);
                DataTable      dt = new DataTable();
                sd.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    byte[] _img = (byte[])dr["resident_fingerprint"];
                    //string id = dr["RESIDENT_ID"].ToString();
                    MemoryStream  ms       = new MemoryStream(_img);
                    DPFP.Template Template = new DPFP.Template();
                    Template.DeSerialize(ms);
                    DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();

                    //  Process(Sample);

                    DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
                    if (features != null)
                    {
                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, Template, ref result);
                        // UpdateStatus(result.FARAchieved);
                        if (result.Verified)
                        {
                            MessageBox.Show("This Resident is already Registered!!!");
                            Reset();
                            FMPIclear();
                            break;
                        }
                        else
                        {
                            MakeReport("fingerprint captured.");
                            SetPrompt("Scan fingerprint again");
                            Process(Sample);
                            if (scans.Text == "0 scans left")
                            {
                                cp.StopCapture();
                            }
                            break;
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch
            {
            }
        }
Beispiel #14
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(FingerprintUtility.ConvertSampleToBitmap(Sample));

            //try
            //{
            DPFP.FeatureSet features = FingerprintUtility.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
            SetPanelColor(System.Drawing.SystemColors.Control);
            SetPrompt("Verifying...");
            if (features != null)
            {
                // Compare the feature set with our template
                bool verified = false;
                foreach (DPFP.Template template in this.Samples.Keys)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, template, ref result);
                    if (result.Verified)
                    {
                        /* this.VerifiedObject = Samples[template];
                         * verified = true;
                         * SetPrompt("Verified.");
                         * Stop();*/
                        this.VerifiedObject = Samples[template];
                        //
                        int value = 0;
                        //get employeeID --> value from template fingerprint
                        bool hasValue = Samples.TryGetValue(template, out value);
                        if (hasValue)
                        {
                            Model.employeeNo = value.ToString();
                        }
                        // MessageBox.Show("EmployeeID: " + Model.employeeNo);
                        insertAttendanceTimeIn(Model.employeeNo);
                        verified = true;
                        SetPrompt("Verified.");

                        //Stop();
                    }
                }
                this.IsVerificationComplete = verified;
                if (!verified)
                {
                    SetPrompt("Finger print not recognised.");
                }
            }
            else
            {
                SetPrompt("Can't recognize as a fingerprint.");
            }
            //}
            //catch (Exception)
            //{
            //    SetPrompt("Error!");
            //}
        }
Beispiel #15
0
        public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
        {
            DPFP.Verification.Verification        ver = new DPFP.Verification.Verification();
            DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            foreach (Staff dt in tempstorage.TempStaffs)
            {
                // Compare feature set with all stored templates.
                foreach (DPFP.Template template in dt.Templates)
                {
                    // Get template from storage.
                    if (template != null)
                    {
                        // Compare feature set with particular template.
                        ver.Verify(FeatureSet, template, ref res);
                        //dt.IsFeatureSetMatched = res.Verified;
                        //dt.FalseAcceptRate = res.FARAchieved;
                        if (res.Verified)
                        {
                            //search for the staff attendance that day
                            Attendance attdance = tempstorage.TempAttendance.Find(x => x.AdminId == tempstorage.TempStaffs.IndexOf(dt).ToString() && x.AttendanceDate == DateTime.Today.Date.ToShortDateString());

                            if (attdance != null)
                            {
                                MessageBox.Show("Attendance already taken for the day.");
                            }
                            else
                            {
                                //keep a spot for attendance
                                Attendance attd = new Attendance();
                                attd.AdminName      = dt.FirstName + " " + dt.LastName;
                                attd.AdminId        = tempstorage.TempStaffs.IndexOf(dt).ToString();
                                attd.AttendanceDate = DateTime.Today.Date.ToShortDateString();
                                attd.TimeIn         = DateTime.Now.TimeOfDay.ToString();
                                tempstorage.TempAttendance.Add(attd);
                                ListEvents.Items.Insert(0, String.Format("Attendance taken for staff: {0}, Time In: {1}, Date: {2}", attd.AdminName, attd.TimeIn, attd.AttendanceDate));
                            }

                            break; // success
                        }
                    }
                }
                if (res.Verified)
                {
                    break; // success
                }
            }



            if (!res.Verified)
            {
                Status = DPFP.Gui.EventHandlerStatus.Failure;
            }
        }
        public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
        {
            DPFP.Verification.Verification        ver = new DPFP.Verification.Verification();
            DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            try
            {
                string mem = null;
                con.Open();
                SqlCommand    cmd      = new SqlCommand("select memName,finger from familyMembers where CardNo='" + CardNo + "'", con);
                SqlDataReader dr       = cmd.ExecuteReader();
                DPFP.Template template = new DPFP.Template();
                while (dr.Read())
                {
                    mem = dr["memName"].ToString();
                    byte[] tmp = (byte[])dr["finger"];
                    template.DeSerialize(tmp);

                    if (template != null)
                    {
                        ver.Verify(FeatureSet, template, ref res);
                        Data.IsFeatureSetMatched = res.Verified;
                        Data.FalseAcceptRate     = res.FARAchieved;
                        string rate = Data.FalseAcceptRate.ToString() + "00";
                        string sp   = rate.Remove(2);
                        label1.Text = sp + " %";
                        if (sp == "00")
                        {
                            label1.Text = "100 %";
                        }

                        if (res.Verified)
                        {
                            MessageBox.Show("Verification Success");
                            con.Close();
                            UserLogin.member = mem;
                            return;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
            }

            //if (!res.Verified)
            //    Status = DPFP.Gui.EventHandlerStatus.Failure;
            //MessageBox.Show("Unauthorized User");
            Data.Update();
        }
Beispiel #17
0
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(Sample);

            // Process the sample and create a feature set for the enrolment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                MySqlConnection cnn = new MySqlConnection();
                //connection to database
                cnn.ConnectionString = "Server=localhost;Database=fpExam;Uid=root;Pwd=;";;
                cnn.Open();
                try
                {
                    MySqlCommand    cmd = new MySqlCommand("SELECT * FROM tbStudFP WHERE Matric_No='" + txtMatric.Text + "'", cnn);
                    MySqlDataReader dr  = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        byte[]       fpbyte = (byte[])dr["FpTemplate"];
                        MemoryStream stream = new MemoryStream(fpbyte);
                        Template = new DPFP.Template(stream);
                        // Compare the feature set with our template
                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, Template, ref result);
                        UpdateStatus(result.FARAchieved);
                        if (result.Verified)
                        {
                            MakeReport("The Fingerprint was VERIFIED SUCCESSFULLY");
                            TxtFullname(dr["Full_Name"].ToString());
                            TxtLevel(dr["Level"].ToString());
                            TxtDept(dr["Department"].ToString());
                        }
                        else
                        {
                            MakeReport("The Fingerprint NOT FOUND!.");
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    cnn.Close();
                }
            }
            else
            {
                MakeReport("Fingerprint does not Exist");
            }
        }
        protected override void Process(DPFP.Sample Sample)
        {
            try
            {
                // Draw fingerprint sample image.
                DrawPicture(ConvertSampleToBitmap(Sample));

                // Process the sample and create a feature set for the enrollment purpose.
                DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    bool found = false;
                    int  index = 0;
                    // Compare the feature set with each of our template

                    for (int i = 0; i < Templates.Count; i++)
                    {
                        var template = Templates[i];
                        Verificator.Verify(features, template, ref result);

                        if (result.Verified)
                        {
                            found = true;

                            MakeReport("VERIFIED SUCCESSFULLY.");

                            Staff = Fingerprints[i].Staff;

                            this.Invoke(new Function(delegate()
                            {
                                this.StaffVerified?.Invoke(this, new EventArgs());
                            }));


                            Start();
                            break;
                        }
                        index++;
                    }
                    if (!found)
                    {
                        MakeReport("VERIFY FAILED.");
                        Start();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error occured while comparing with fingerprint database. \n\r\n\r" + ex.ToString());
            }
        }
Beispiel #19
0
        protected void Process(DPFP.Sample Sample)
        {
            TimeSpan begin = TimeSpan.Parse("07:00");
            TimeSpan stop  = TimeSpan.Parse("19:00");
            TimeSpan now   = DateTime.Now.TimeOfDay;

            if (now >= begin && now <= stop)
            {
                bool verified = false;
                // Draw fingerprint sample image.
                DrawPicture(ConvertSampleToBitmap(Sample));

                // Process the sample and create a feature set for the enrollment purpose.
                DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    foreach (var val in list)
                    {
                        Staff_finger = val;
                        f_print      = Convert.FromBase64String(val);
                        DPFP.Template temp = new DPFP.Template();
                        temp.DeSerialize(f_print);
                        Template = temp;


                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, Template, ref result);
                        //UpdateStatus(result.FARAchieved);
                        if (result.Verified)
                        {
                            verified = true;
                            MakeReport("The fingerprint was VERIFIED.");
                            checktimeOut();
                            //dbAccess();
                        }
                    }
                    // Compare the feature set with our template
                    if (!verified)
                    {
                        MessageBox.Show("Invalid staff");
                    }
                }
            }
            else
            {
                MessageBox.Show("System Inactive");
            }
        }
        protected void ProcessVerify(DPFP.Sample Sample)
        {
            try
            {
                // Draw fingerprint sample image.
                DrawPicture(ConvertSampleToBitmap(Sample));

                // Process the sample and create a feature set for the enrollment purpose.
                DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    bool found = false;
                    int  index = 0;
                    // Compare the feature set with each of our template
                    foreach (var llt in Owners)
                    {
                        Verificator.Verify(features, llt, ref result);

                        if (result.Verified)
                        {
                            found = true;
                            using (var db = new LandxEntities())
                            {
                                Dlandlord = db.People.Find(psnId);
                            }
                            MakeReport("The fingerprint was VERIFIED.");
                            displayMsg("Welcome " + Dlandlord.ApplicantsFullname);
                            enableNextFP();

                            break;
                        }
                        index++;
                    }
                    if (!found)
                    {
                        MakeReport("The fingerprint was NOT VERIFIED.");
                    }
                }

                Capturer.StartCapture();
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error occured while comparing with fingerprint database. \n\r\n\r" + ex.ToString());
            }
        }
Beispiel #21
0
        protected void Process(DPFP.Sample Sample)
        {
            baseProcess(Sample);


            foreach (string keysTemplate in ListTemplate.Keys)
            {
                Verificator = new DPFP.Verification.Verification();
                DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
                if (features != null)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    DPFP.Template[] arrayTemplate = ListTemplate[keysTemplate];
                    Verificator.Verify(features, arrayTemplate[0], ref result);
                    UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        getUerData(keysTemplate);

                        return;
                    }
                    Verificator.Verify(features, arrayTemplate[1], ref result);
                    UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        getUerData(keysTemplate);

                        return;
                    }
                }
            }

            MakeReport("Jugador no Encontrado en la Base de Datos de AFC ");
            Message("Jugador no Encontrado en la Base de Datos de AFC ");
            UserName(" ", " ", " ", "", " ", " ", " ", " ", " ");
            btn();
        }
Beispiel #22
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            Bitmap BMP = ConvertSampleTobitmap(Sample);

            DrawPicture(BMP);
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                Verificator.Verify(features, Template, ref result);
                //UpdateStatus(result.FARAchieved);
                Verificador(result.Verified);
            }
        }
        protected void Process(DPFP.Sample Sample)
        {
            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();

                DPFP.Template template = new DPFP.Template();
                Stream        stream;

                //Obtenemos una lista con los datos del usuario.
                List <Usuario> conexiones = ConexionBD.Muestra();

                foreach (var con in conexiones)
                {
                    if (con.huella != null)
                    {
                        stream   = new MemoryStream(con.huella);
                        template = new DPFP.Template(stream);
                        try
                        {
                            Verificator.Verify(features, template, ref result);
                        }
                        catch (Exception e)
                        {
                            MessageBox.Show("error" + e.Message);
                        }

                        if (result.Verified)
                        {
                            this.Dispatcher.Invoke(new Function(delegate() {
                                Desplegar(con);
                            }));

                            break;
                        }
                    }
                }
            }
        }
Beispiel #24
0
 public void OnComplete(object Capture, string ReaderSerialNumber, Sample Sample)
 {
     DPFP.Verification.Verification        Ver = new DPFP.Verification.Verification();
     DPFP.Verification.Verification.Result Res = new DPFP.Verification.Verification.Result();
     DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
     foreach (AppData Te in Temp)
     {
         if (Te != null)
         {
             Ver.Verify(features, Te.Template, ref Res);
             if (Res.Verified)
             {
                 MessageBox.Show(String.Format("Se encontro la huella en el usuario {0}", Te.IDCliente));
                 break; // se encontro
             }
         }
     }
 }
        protected void Process(DPFP.Sample Sample)
        {
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            if (features != null)
            {
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                Verificator.Verify(features, (DPFP.Template)Application.Current.Properties["template"], ref result);
                if (result.Verified)
                {
                    SetPrompt("Отпечатки совпадают");
                }
                else
                {
                    SetPrompt("Отпечатки не совпадают");
                }
            }
        }
Beispiel #26
0
        public void Verify(DPFP.Sample Sample)
        {
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                try
                {
                    Verificator.Verify(features, this.curTemplate, ref result);
                    if (result.Verified)
                    {
                        this.Dispatcher.Invoke(() =>
                        {
                            if (this.ClockShow != null)
                            {
                                this.ClockShow.Controller.Pause();
                            }
                            ColorAnimation animation = new ColorAnimation();
                            animation.From           = (this.UIFinger_Printer.Foreground as SolidColorBrush).Color;
                            animation.To             = Colors.Green;
                            animation.Duration       = new Duration(TimeSpan.FromMilliseconds(450));
                            animation.EasingFunction = new PowerEase()
                            {
                                Power = 5, EasingMode = EasingMode.EaseInOut
                            };
                            this.ClockHide = animation.CreateClock();
                            this.UIFinger_Printer.Foreground.ApplyAnimationClock(SolidColorBrush.ColorProperty, ClockHide);
                            flagFinger = true;
                        });
                        this.Stop();
                    }
                    else
                    {
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Beispiel #27
0
        public void Process(DPFP.Sample Sample)
        {
            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                foreach (var item in funcionarios)
                {
                    if (item.Digital != null)
                    {
                        Template = new Template();
                        Template.DeSerialize(item.Digital);
                        Verificator.Verify(features, Template, ref result);
                        if (result.Verified)
                        {
                            funcionario         = item;
                            impressaoLocalizada = true;
                            return;
                        }
                    }
                }

                if (result.Verified)
                {
                    updateStatus("Impressão digital localizada com sucesso.");
                }
                else
                {
                    impressaoLocalizada = false;
                    updateStatus("Impressão digital não localizada. \nTente novamente.");
                    this.Invoke(new Function(delegate() { limparTela(); }));
                    Application.DoEvents();
                    cp.StopCapture();
                    cp = new DPFP.Capture.Capture();
                    cp.StartCapture();
                    cp.EventHandler = this;
                }
            }
        }
        protected void Process(DPFP.Sample Sample)
        {
            DrawPicture(ConvertSampleToBitmap(Sample));

            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                Stream stream;

                DataTable      dt             = new DataTable();
                HuellaDactilar huellaDactilar = new HuellaDactilar();
                dt = PreparandoAcceso.BuscaHuellas(huellaDactilar.conex);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string huella     = dt.Rows[i][1].ToString();
                    byte[] byteHuella = dt.Rows[i][1] as byte[];
                    stream   = new MemoryStream(byteHuella);
                    Template = new DPFP.Template(stream);

                    Verificator.Verify(features, Template, ref result);
                    UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        MakeReport($"Huella Aceptada de {dt.Rows[i][0]}");
                        Votacion Votacion = new Votacion();

                        MessageBox.Show(new Form()
                        {
                            TopMost = true
                        }, $"Huella Aceptada de { dt.Rows[i][0]}");
                        Votacion.ShowDialog();

                        break;
                    }
                }
            }
        }
Beispiel #29
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(FingerPrintUtility.ConvertSampleToBitmap(Sample));

            try
            {
                nom = 0;
                DPFP.FeatureSet features = FingerPrintUtility.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
                SetPanelColor(Color.FromArgb(64, 69, 76));
                SetPrompt("Detectando...");
                if (features != null)
                {
                    // Compare the feature set with our template
                    verified = false;
                    foreach (DPFP.Template template in this.Samples.Keys)
                    {
                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, template, ref result);
                        if (result.Verified)
                        {
                            this.VerifiedObject = Samples[template];
                            verified            = true;
                            SetPrompt("Verificado");
                            resultado = nom;
                            Stop();
                        }
                        nom++;
                    }
                    this.IsVerificationComplete = verified;
                    if (!verified)
                    {
                        SetPrompt("Incorrecta");
                    }
                }
                else
                {
                    SetPrompt("Fallando");
                }
            }
            catch (Exception e)
            {
                SetPrompt("Error!");
            }
        }
Beispiel #30
0
        private void VerificationControl_OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
        {
            lblStatus.Text = "Checking ...";
            // TODO: get templates and compare
            DPFP.Verification.Verification        ver = new DPFP.Verification.Verification();
            DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();
            FingerData last_tested = StaticFarm.lastFinger;

            foreach (FingerData fd in fdx)
            {
                DPFP.Template template = convertTemplate(fd.finger);
                if (fd.finger == String.Empty)
                {
                    template = null;
                }

                // Get template from storage.
                if (template != null)
                {
                    // Compare feature set with particular template.
                    ver.Verify(FeatureSet, template, ref res);
                    last_tested = fd;
                    if (res.Verified)
                    {
                        break; // success
                    }
                }
            }
            if (!res.Verified)
            {
                Status         = DPFP.Gui.EventHandlerStatus.Failure;
                lblStatus.Text = "Authorization Failed Try again ...";
            }
            else
            {
                lblStatus.Text = "Successfully Verified.";
                Status         = DPFP.Gui.EventHandlerStatus.Success;


                StaticFarm.SignInPage.GotoHome();
                this.Close();
            }
        }
Beispiel #31
0
        private string[] VerifyDB(DPFP.FeatureSet features)
        {
            string[]       arr = new string[5];
            OdbcConnection cn;
            OdbcCommand    cmd;

            byte[] temp     = new byte[0];
            string query    = "Select * from fpbasic";
            string dsnname  = "fpbasic";
            string uid      = "Administrator";
            string password = "******";

            cn = new OdbcConnection("dsn=" + dsnname + "; UID=" + uid + "; PWD=" + password + ";");
            cn.Open();
            cmd = new OdbcCommand(query, cn);
            OdbcDataReader reader = cmd.ExecuteReader();

            DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
            Verifier = new DPFP.Verification.Verification();
            while (reader.Read())
            {
                for (int index = 0; index < reader.FieldCount; index++)
                {
                    Stream        stream = new MemoryStream((byte[])reader.GetValue(5));
                    DPFP.Template obj    = new DPFP.Template(stream);
                    Verifier.Verify(features, obj, ref result);
                    if (result.Verified)
                    {
                        arr[0] = "true";
                        arr[1] = reader.GetString(1);
                        arr[2] = reader.GetString(2);
                        arr[3] = reader.GetString(3);
                        arr[4] = reader.GetInt32(4).ToString();
                        return(arr);
                    }
                }
            }

            cn.Close();
            arr[0] = "false";
            return(arr);
        }
    public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status) {
      DPFP.Verification.Verification ver = new DPFP.Verification.Verification();
      DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

      // Compare feature set with all stored templates.
      foreach (DPFP.Template template in Data.Templates) {
        // Get template from storage.
        if (template != null) {
          // Compare feature set with particular template.
          ver.Verify(FeatureSet, template, ref res);
          Data.IsFeatureSetMatched = res.Verified;
          Data.FalseAcceptRate = res.FARAchieved;
          if (res.Verified)
            break; // success
        }
      }

      if (!res.Verified)
        Status = DPFP.Gui.EventHandlerStatus.Failure;

      Data.Update();
    }
        public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
        {
            DPFP.Verification.Verification ver = new DPFP.Verification.Verification();
            DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            //string conStr = "Data Source=.; Initial Catalog=Registration; Integrated Security=true";

            //SqlConnection con = new SqlConnection(conStr);
            //SqlCommand cmd = new SqlCommand("Select FingerPrintData from FingerPrints where Id = 11", con);

            //con.Open();

            //byte[] userFingerPrintData = new byte[0];

            //using (con)
            //{
            //    userFingerPrintData = cmd.ExecuteScalar() as byte[];
            //}

            //byte[] fingerPrintCode = new StudentDAC().GetFingerCodeById(2);

            List<Guardian> guardians = new GuardianDAC().SelectAllGuardians();
           
            if (guardians != null && guardians.Count > 0)
            {
                foreach (var item in guardians)
                {
                    ver = new DPFP.Verification.Verification();
                    res = new DPFP.Verification.Verification.Result();
                    DPFP.Template temp = new DPFP.Template();

                    if (item.FingerCode != null)
                    {
                        temp.DeSerialize(item.FingerCode);

                        if (temp != null)
                        {
                            // Compare feature set with particular template.

                            ver.Verify(FeatureSet, temp, ref res);

                            if (res.Verified)
                            {
                                guardiansTakeAwayForm.guardian = item;

                                this.Close();
                                break;
                            }
                        }
                    }
                    
                }
            }

            
            
            if (!res.Verified)
                Status = DPFP.Gui.EventHandlerStatus.Failure;

        }
    public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status) {
      DPFP.Verification.Verification ver = new DPFP.Verification.Verification();
      DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            string conStr = "Data Source=.; Initial Catalog=Registration; Integrated Security=true";

            SqlConnection con = new SqlConnection(conStr);
            SqlCommand cmd = new SqlCommand("Select FingerPrintData from FingerPrints where Id = 6", con);

            con.Open();

            byte[] userFingerPrintData = new byte[0];

            using (con)
            {
                userFingerPrintData = cmd.ExecuteScalar() as byte[];
            }

            DPFP.Template temp = new DPFP.Template();
            temp.DeSerialize(userFingerPrintData);

            if (temp != null)
            {
                // Compare feature set with particular template.

                ver.Verify(FeatureSet, temp, ref res);
                Data.IsFeatureSetMatched = res.Verified;
                Data.FalseAcceptRate = res.FARAchieved;
            }


            // Compare feature set with all stored templates.
            foreach (DPFP.Template template in Data.Templates) {
        // Get template from storage.
        //if (template != null) {
        //  // Compare feature set with particular template.
          
        //  ver.Verify(FeatureSet, template, ref res);
        //  Data.IsFeatureSetMatched = res.Verified;
        //  Data.FalseAcceptRate = res.FARAchieved;
        //  if (res.Verified)
        //    break; // success
        //}
      }

      if (!res.Verified)
        Status = DPFP.Gui.EventHandlerStatus.Failure;

      Data.Update();
    }