Unable to save processed fingerprint image using VeriFinger

I'm trying to use the SDK VeriFinger from Neurotechnology , to process the file BMP, containing fingerprint capture (to improve), and save it as a new file BMP.

VeriFinger comes with several tutorials and examples, the main of which is called FingersSampleWX.

It looks like this:

FingersSampleWX screenshot

Following this source code of the application as a guide, I was able to compile this piece of code that should do what I want, or I think so:

#include <iostream>
#include <NLicensing.hpp>
#include <NMedia.hpp>
#include <NBiometrics.hpp>

using namespace Neurotec::Biometrics;
using namespace Neurotec::Images;
using namespace Neurotec::Licensing;

int main()
{
    if (NLicense::ObtainComponents("/local", "5000", "Biometrics.FingerExtraction"))
        std::wcout << L"License OK\n";
    else
        std::wcout << L"License fail\n";

    NFinger finger;
    finger.SetFileName("F:\\input\\000001\\MDT1.BMP");
    finger.SetPosition(nfpUnknown);
    finger.SetImpressionType(nfitNonliveScanPlain);

    // testing
    auto test1 = finger.GetFileName();
    auto test2 = finger.GetImage();
    auto test3 = finger.GetProcessedImage();

    NImage image(NULL);
    if (finger.GetHandle())
    {
        image = finger.GetProcessedImage();

        if (image.GetHandle())
            image.Save("F:\\output\\000001\\MDT1_out.bmp");
    }   
    NLicense::ReleaseComponents("Biometrics.FingerExtraction");
}

However, the image will not be saved. For some reason, the string if (image.GetHandle())returns false. This is why I added a section testing.

test2 test3 :

handle = 0x00000000 isDisposed = false

GetProcessedImage() NULL, , test1 finger. , - ... .

VeriFinger 30- (700 ). SDK Documentation CHM PDF.

.

+5
2

, :

  1. Client::NBiometricClient

  2. - SetFingersReturnProcessedImage() true

  3. NSubject

  4. - SetId() NStringWrapper - C ( finger.SetFileName()), , finger.SetFileName()

  5. - GetFingers() Add() , Add() NFinger ( finger )

  6. NBiometricTask - , 1, CreateTask() : nboEnroll () NULL

  7. - GetSubjects() Add() , Add() , 3

  8. - , 1, PerformTask(), , 6.

:

// (previous code from question)
NFinger finger;
finger.SetFileName("F:\\input\\000001\\MDT1.BMP");
finger.SetPosition(nfpUnknown);
finger.SetImpressionType(nfitNonliveScanPlain);

// Needed initializations:
Client::NBiometricClient m_biometricClient;
m_biometricClient.SetFingersReturnProcessedImage(true);
NBiometricTask task = m_biometricClient.CreateTask(nboEnroll, NULL);

NSubject subject;
subject.SetId("F:\\input\\000001\\MDT1.BMP");   // I'm just using the filename as argument as its purpose is rather temporary
subject.GetFingers().Add(finger);

task.GetSubjects().Add(subject);
m_biometricClient.PerformTask(task);
// ok, everything should work now

// (...)

user3791372 .

+1

- , , , .

. , , . , GetImage() test2 var? , , .

, , NFinger, -, , - NFinger. , - NFinger, . NSubject.hpp, , FingersCollection, , , .

"" :

NSubject subject;
subject.SetId("Some Unique String");
subject.GetFingers().Add(finger);

, , m_biometricClient , , m_biometricClient.SetFingersReturnProcessedImage(true) , ! , FingersSampleForm.cpp. , , , (. void FingersSampleForm::OnEnroll) nboEnroll.

+3

Source: https://habr.com/ru/post/1610061/


All Articles