Пример #1
0
        private Int32 MatchScore(Byte[] scan, Byte[] saved)
        {
            Int32 matchScore = 0;

            fpm.GetMatchingScore(scan, saved, ref matchScore);
            return(matchScore - 80);
        }
Пример #2
0
        private void btnVerifyFingerPrint_Click(object sender, EventArgs e)
        {
            try
            {
                Int32 iError;
                bool  matched1 = false;
                bool  matched2 = false;
                SGFPMSecurityLevel secu_level;
                Int32 match_score = 0;

                secu_level = SGFPMSecurityLevel.BELOW_NORMAL;

                iError = m_FPM.MatchTemplate(m_RegMin1, m_RegMin3, secu_level, ref matched1);
                iError = m_FPM.MatchTemplate(m_RegMin2, m_RegMin3, secu_level, ref matched2);
                iError = m_FPM.GetMatchingScore(m_RegMin1, m_RegMin2, ref match_score);

                if (picR1 != null && picR2 != null && picR3 != null)
                {
                    if (iError == (Int32)SGFPMError.ERROR_NONE)
                    {
                        if (matched1 & matched2)
                        {
                            StatusBars.Text = "Verification Success, Matching Score: " + match_score;
                        }
                        else
                        {
                            StatusBars.Text = "Verification Failed";
                        }
                    }
                    else
                    {
                        DisplayError("MatchTemplate()", iError);
                    }
                }
                else
                {
                    MessageBox.Show("Please load an image", "Error Loading Image");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Please Load Image");
            }
        }
        private bool CheckVoter()
        {
            Int32 iError;
            bool  checkVoter = false;
            bool  matched1   = false;
            bool  matched2   = false;
            SGFPMSecurityLevel secuLevel;
            Int32 matchScore = 0;

            secuLevel = SGFPMSecurityLevel.BELOW_NORMAL;

            iError = _mFpm.MatchTemplate(_mRegMin1, _mRegMin3, secuLevel, ref matched1);
            iError = _mFpm.MatchTemplate(_mRegMin2, _mRegMin3, secuLevel, ref matched2);
            iError = _mFpm.GetMatchingScore(_mRegMin1, _mRegMin2, ref matchScore);

            if (imgR1.Image != null && imgR2.Image != null && imgR3.Image != null)
            {
                if (iError == (Int32)SGFPMError.ERROR_NONE)
                {
                    if (matched1 & matched2)
                    {
                        statusBar.Text = @"Verification Success, Matching Score: " + matchScore;
                        checkVoter     = true;
                    }
                    else
                    {
                        statusBar.Text = @"Verification Failed";
                    }
                }
                else
                {
                    statusBar.Text = _error.DisplayError(@"MatchTemplate()", iError);
                }
            }
            else
            {
                MetroMessageBox.Show(this, @"Please load an image", @"Error Loading Image");
            }
            return(checkVoter);
        }