在Digital persona Fingerprint SDK中创建FeatureSet

时间:2017-04-24 11:54:51

标签: c# fingerprint fingerprinting digital-persona-sdk

我在C#中创建指纹验证系统。我有数字角色U.are.U 4500指纹识别器。我正在阅读sdk以创建我自己的应用程序,但我仍然坚持使用FeatureExtraction'步。它向模板添加功能时给出了错误,表示对象引用未设置为对象的实例。我检查了我的代码并在项目顶部启动我的注册对象公开,但错误仍然相同。 这是我的代码,它给了我错误。

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.");
            }

这是' ExtractFeatures'正确返回要素对象的函数。

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;
    }

如果有人可以提供帮助那么请帮助我解决我的问题。 感谢

1 个答案:

答案 0 :(得分:0)

请在代码中查看以下内容:

  1. ExtractFeatures的方法定义: protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample, DPFP.Processing.DataPurpose用途
  2. 您正在传递参数类型enrollement而不是未定义的参数类型DataPurpose。

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

    1. 此外,在ExtractFeatures方法中,您将返回未在方法中声明的变量要素。代码应如下:

      protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample示例,DPFP.Processing.DataPurpose目的)         {             DPFP.Processing.FeatureExtraction Extractor = new DPFP.Processing.FeatureExtraction(); //创建一个特征提取器             DPFP.Capture.CaptureFeedback feedback = DPFP.Capture.CaptureFeedback.None;              DPFP.FeatureSet features = new DPFP.FeatureSet();             Extractor.CreateFeatureSet(Sample,Purpose,ref feedback,ref features); // TODO:结果返回功能?             if(feedback == DPFP.Capture.CaptureFeedback.Good)                 返回功能;             其他                 return null;         }

    2. 希望有所帮助。