0

i am creating fingerprint verification system in C#. i have digital persona U.are.U 4500 fingerprint reader. i am reading sdk to create my own application but i am stuck on 'FeatureExtraction' step. it gives me error while adding features to template says 'object refrence not set to instance of object. i have checked my code and initiate my enrollment object at the top of project as public but the error is still the same. here is my code that gives me the error.

DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

        // Check quality of the sample and add to enroller if it's good
        if (features != null) try
            {
                Enroller.AddFeatures(features);     // Add feature set to template.
                MessageBox.Show("The fingerprint feature set was created.");
            }

here is the 'ExtractFeatures' function that is returning the features object correctly.

protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose)
    {
        DPFP.Processing.FeatureExtraction Extractor = new DPFP.Processing.FeatureExtraction();  // Create a feature extractor
        DPFP.Capture.CaptureFeedback feedback = DPFP.Capture.CaptureFeedback.None;

        Extractor.CreateFeatureSet(Sample, Purpose, ref feedback, ref features);            // TODO: return features as a result?
        if (feedback == DPFP.Capture.CaptureFeedback.Good)
            return features;
        else
            return null;
    }

if anyone can help then please help me solve my issue. thanks

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Delicate Hiba
  • 63
  • 1
  • 5
  • 13

1 Answers1

0

Please check the following in your code:

  1. Method definition for ExtractFeatures: protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose)

You are passing a parameter type enrollement instead of a parameter type DataPurpose which is not defined.

DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

  1. Also, inside your ExtractFeatures method, you are returning a variable features which is not declared inside your method. Code should be as follows:

    protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose) { DPFP.Processing.FeatureExtraction Extractor = new DPFP.Processing.FeatureExtraction(); // Create a feature extractor DPFP.Capture.CaptureFeedback feedback = DPFP.Capture.CaptureFeedback.None; DPFP.FeatureSet features = new DPFP.FeatureSet(); Extractor.CreateFeatureSet(Sample, Purpose, ref feedback, ref features); // TODO: return features as a result? if (feedback == DPFP.Capture.CaptureFeedback.Good) return features; else return null; }

Hope that helps.

dsalas
  • 139
  • 1
  • 2
  • 8