Click here to Skip to main content
15,884,059 members
Please Sign up or sign in to vote.
1.67/5 (2 votes)
**These are the codes of enrolling fingerprint. but I want it to save directly in MySQL database.

VB
' NOTE: This form is inherited from the CaptureForm,
' so the VisualStudio Form Designer may not load this properly
' (at least until you build the project).
' If you want to make changes in the form layout - do it in the base CaptureForm.
' All changes in the CaptureForm will be reflected in all derived forms 
' (i.e. in the EnrollmentForm and in the VerificationForm)


Public Class EnrollmentForm
  Inherits CaptureForm

  Public Event OnTemplate(ByVal template)

  Private Enroller As DPFP.Processing.Enrollment

  Protected Overrides Sub Init()
    MyBase.Init()
    MyBase.Text = "Fingerprint Enrollment"
    Enroller = New DPFP.Processing.Enrollment()     ' Create an enrollment.
    UpdateStatus()
  End Sub

  Protected Overrides Sub Process(ByVal Sample As DPFP.Sample)
    MyBase.Process(Sample)

    ' Process the sample and create a feature set for the enrollment purpose.
    Dim features As DPFP.FeatureSet = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment)

    ' Check quality of the sample and add to enroller if it's good
    If (Not features Is Nothing) Then
      Try
        MakeReport("The fingerprint feature set was created.")
        Enroller.AddFeatures(features)        ' Add feature set to template.
      Finally
        UpdateStatus()

        ' Check if template has been created.
        Select Case Enroller.TemplateStatus
          Case DPFP.Processing.Enrollment.Status.Ready    ' Report success and stop capturing
            RaiseEvent OnTemplate(Enroller.Template)
            SetPrompt("Click Close, and then click Fingerprint Verification.")
            StopCapture()

          Case DPFP.Processing.Enrollment.Status.Failed   ' Report failure and restart capturing
            Enroller.Clear()
            StopCapture()
            RaiseEvent OnTemplate(Nothing)
            StartCapture()

        End Select
      End Try
    End If
  End Sub

  Protected Sub UpdateStatus()
    ' Show number of samples needed.
    SetStatus(String.Format("Fingerprint samples needed: {0}", Enroller.FeaturesNeeded))
  End Sub

End Class
Posted
Updated 18-Jul-17 2:02am
v4
Comments
Richard MacCutchan 7-Mar-14 13:31pm    
Where is the data actually captured, and what object type is it saved into?
Leetian04 7-Mar-14 15:34pm    
from the biometrics, it saved as .ftp file.

The enrolled fingerprint data can be found in Enroller.Template. Then use MemoryStream to to save and serialize the said fingerprint data. then pass the memorystream to your byte[] in order to upload it to your longblob column in your database.


Here's My example code in c# format:

C#
byte[] byted;
private void featureS()
        {
            this.Invoke(new Function(delegate ()
            {
                MemoryStream fingerprintData = new MemoryStream();
                Enroller.Template.Serialize(fingerprintData);
                byted = fingerprintData.ToArray();

                //insert your mysql command here then
            }));
        }


I hope this gives you an idea. But before you save the fingerprint template, you must first verify if it already exist in the database.
 
Share this answer
 
v2
Good day sir Louie Aguilar, Do you have sample for this in VB codes? thanks in advance :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900