admin管理员组

文章数量:1221457

I'm using DigitalPersona for my biometrics and I installed the u 3.2.0 version. I'm having a problem retrieving the saved fingerprint from the database. I ensure that the data is formatted as ANSI. I don't know if my process of saving fingerprint data to the database is right.

I tried changing the format from ANSI to ISO but nothing works.

Here is for enrollment form:

Public Sub OnCaptured(ByVal captureResult As CaptureResult)
    Try
        ' Check capture quality and throw an error if bad.
        If Not _sender.CheckCaptureResult(captureResult) Then Return

        count += 1

        ' Create the FMD from the captured fingerprint
        Dim resultConversion As DataResult(Of Fmd) = FeatureExtraction.CreateFmdFromFid(captureResult.Data, Formats.Fmd.ANSI)

        If resultConversion.ResultCode <> Constants.ResultCode.DP_SUCCESS Then
            _sender.Reset = True
            Throw New Exception("" & resultConversion.ResultCode.ToString())
        End If

        ' Add the FMD to the preenrollment list
        preenrollmentFmds.Add(resultConversion.Data)

        SendMessage(Action.SendMessage, "A finger was captured.  " & vbCrLf & "Count:  " & (count.ToString()))

        If count >= 4 Then
            ' Convert list to array of FMDs before calling CreateEnrollmentFmd
            Dim enrolledFmdArray As Fmd() = preenrollmentFmds.ToArray()

            ' Create an Enrollment FMD
            Dim resultEnrollment As DataResult(Of Fmd) = DPUruNet.Enrollment.CreateEnrollmentFmd(Formats.Fmd.ANSI, enrolledFmdArray)

            If resultEnrollment.ResultCode = ResultCode.DP_SUCCESS Then
                SendMessage(Action.SendMessage, "An enrollment FMD was successfully created.")
                SendMessage(Action.SendMessage, "Place a finger on the reader.")

                ' Save the enrollment FMD to the database
                SaveFingerprintToDatabase(resultEnrollment.Data)

                count = 0
                preenrollmentFmds.Clear()
                Return
            ElseIf (resultEnrollment.ResultCode = Constants.ResultCode.DP_ENROLLMENT_INVALID_SET) Then
                SendMessage(Action.SendMessage, "Enrollment was unsuccessful.  Please try again.")
                SendMessage(Action.SendMessage, "Place a finger on the reader.")
                count = 0
                preenrollmentFmds.Clear()
                Return
            End If
        End If

        SendMessage(Action.SendMessage, "Now place the same finger on the reader.")
    Catch ex As Exception
        SendMessage(Action.SendMessage, "Error:  " & ex.Message)
    End Try
End Sub

Here is from the identification form:

Public Sub OnCaptured(ByVal captureResult As CaptureResult)
    Try
        ' Check capture quality and throw an error if bad.
        If Not _sender.CheckCaptureResult(captureResult) Then Return

        SendMessage(Action.SendMessage, "A finger was captured.")

        ' Create the FMD from the captured fingerprint
        Dim resultConversion As DataResult(Of Fmd) = FeatureExtraction.CreateFmdFromFid(captureResult.Data, Formats.Fmd.ANSI)

        If resultConversion.ResultCode <> Constants.ResultCode.DP_SUCCESS Then
            If resultConversion.ResultCode <> Constants.ResultCode.DP_TOO_SMALL_AREA Then
                _sender.Reset = True
            End If
            Throw New Exception("" & resultConversion.ResultCode.ToString())
        End If

        ' Retrieve the enrolled FMDs from the database
        Dim enrolledFmds As List(Of Fmd) = GetEnrolledFmdsFromDatabase()

        If enrolledFmds.Count > 0 Then
            ' Convert List to Array for comparison
            Dim enrolledFmdArray As Fmd() = enrolledFmds.ToArray()

            ' Set the threshold score (adjust as needed)
            Dim thresholdScore As Integer = DPFJ_PROBABILITY_ONE * 1 / 1000

            ' Use Identify function for comparison (returns an array of matching candidates)
            Dim identifyResult As IdentifyResult = Comparison.Identify(resultConversion.Data, 0, enrolledFmdArray, thresholdScore, 5)

            If identifyResult.ResultCode = Constants.ResultCode.DP_SUCCESS Then
                If identifyResult.Indexes.Length > 0 Then
                    ' Match found
                    SendMessage(Action.SendMessage, "Fingerprint matched with an enrolled FMD!")
                Else
                    SendMessage(Action.SendMessage, "No match found in the database.")
                End If
            Else
                SendMessage(Action.SendMessage, "Error during identification: " & identifyResult.ResultCode.ToString())
            End If
        Else
            SendMessage(Action.SendMessage, "No enrolled fingerprints found in the database.")
        End If

        ' Reset for the next capture
        count = 0
    Catch ex As Exception
        SendMessage(Action.SendMessage, "Error: " & ex.Message)
    End Try
End Sub

本文标签: vbnethow to properly retrieve a fingerprint data in mariadbusing VBStack Overflow