iOS related questions

General information about Neurotechnology and its software

iOS related questions

Postby pratikxeb » Jan 06, 2016 09:01

Hello,
How do I activate licence (internet licence with .LIC file) for IOS device? Is there any other procedure of licence activation method, suitable for IOS?
One more thing I want to ask, if I have activated licence, then do I need to call NLicenseObtainComponents(N_T("/local"), N_T("5000"), components, &available)
which we used in tutorial code?? If no, then what is the proper way to obtain components from activated licence.


Thanks
pratikxeb
 
Posts: 13
Joined: Dec 19, 2015 08:47

Re: Activating Licence for IOS device

Postby MartynasV » Jan 06, 2016 10:52

pratikxeb wrote:Hello,
How do I activate licence (internet licence with .LIC file) for IOS device? Is there any other procedure of licence activation method, suitable for IOS?
One more thing I want to ask, if I have activated licence, then do I need to call NLicenseObtainComponents(N_T("/local"), N_T("5000"), components, &available)
which we used in tutorial code?? If no, then what is the proper way to obtain components from activated licence.


Thanks

Hello,

Internet licenses do not require activation.

Before calling NLicenseObtainComponents(), call NLicenseAdd(LICENSE_CONTENT). Read LICENSE_CONTENT as text from license file, then provide it to add function. This add function will load license to memory and you will be able to obtain components.

Code: Select all
result = NStringCreate(N_T("c:\\temp\\_SDKs\\_LicenseFiles\\Neurotechnology_Trial_Internet_Licenses.lic"), &file);
result = NFileReadAllTextN(file, &license);
result = NLicenseAddN(license);

You have to obtainComponents, otherwise you will get "Not activated" exception.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 258
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: Activating Licence for IOS device

Postby pratikxeb » Jan 06, 2016 11:51

MartynasV wrote:
pratikxeb wrote:Hello,
How do I activate licence (internet licence with .LIC file) for IOS device? Is there any other procedure of licence activation method, suitable for IOS?
One more thing I want to ask, if I have activated licence, then do I need to call NLicenseObtainComponents(N_T("/local"), N_T("5000"), components, &available)
which we used in tutorial code?? If no, then what is the proper way to obtain components from activated licence.


Thanks

Hello,

Internet licenses do not require activation.

Before calling NLicenseObtainComponents(), call NLicenseAdd(LICENSE_CONTENT). Read LICENSE_CONTENT as text from license file, then provide it to add function. This add function will load license to memory and you will be able to obtain components.

Code: Select all
result = NStringCreate(N_T("c:\\temp\\_SDKs\\_LicenseFiles\\Neurotechnology_Trial_Internet_Licenses.lic"), &file);
result = NFileReadAllTextN(file, &license);
result = NLicenseAddN(license);

You have to obtainComponents, otherwise you will get "Not activated" exception.

Thank you...
pratikxeb
 
Posts: 13
Joined: Dec 19, 2015 08:47

Re: Activating Licence for IOS device

Postby pratikxeb » Jan 06, 2016 13:30

Hello,

I followed your steps to load license in memory.
Now, I am getting an error in NLicenseAddN() as given below,
NLicenseAddN() failed, result = -5
NError[10654]: [TID: 140087623632704] (-5) Operation is not implemented
How do I resolve this?

One more thing I want to add in this, After loading license to memory, do I need internet connection for further operation?

Thanks
pratikxeb
 
Posts: 13
Joined: Dec 19, 2015 08:47

Re: Activating Licence for IOS device

Postby MartynasV » Jan 06, 2016 14:22

pratikxeb wrote:Hello,

I followed your steps to load license in memory.
Now, I am getting an error in NLicenseAddN() as given below,
NLicenseAddN() failed, result = -5
NError[10654]: [TID: 140087623632704] (-5) Operation is not implemented
How do I resolve this?

One more thing I want to add in this, After loading license to memory, do I need internet connection for further operation?

Thanks

Hello,

Please provide SDK revision number(can be found in SDK root directory, in Revision.txt file).
On what exact device you are trying to execute that code? What iOS version is used?


One more thing I want to add in this, After loading license to memory, do I need internet connection for further operation?

Yes, internet license tries to communicate with our server every 30 minutes, if it fails, license stops working until successful connection is made again.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 258
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: Activating Licence for IOS device

Postby pratikxeb » Jan 07, 2016 10:54

MartynasV wrote:
pratikxeb wrote:Hello,

I followed your steps to load license in memory.
Now, I am getting an error in NLicenseAddN() as given below,
NLicenseAddN() failed, result = -5
NError[10654]: [TID: 140087623632704] (-5) Operation is not implemented
How do I resolve this?

One more thing I want to add in this, After loading license to memory, do I need internet connection for further operation?

Thanks

Hello,

Please provide SDK revision number(can be found in SDK root directory, in Revision.txt file).
On what exact device you are trying to execute that code? What iOS version is used?

Hello,
I am using iOS v8.4
NLicenseAddN() this function worked perfectly, without an error. So license is loaded in memory.
My code flow is as follow:
Code: Select all
result = NStringCreate(N_T(filepath), &file);
result = NFileReadAllTextN(file, &license);
result = NLicenseAddN(license);
result = NLicenseObtainComponents(N_T("/local"), N_T("5000"), components, &available);

I have written this code on app launch.

When device is connected to Internet, NLicenseObtainComponents() works successfully.
Now, there is no Internet connectivity on device and I relaunch the app.
In this case, I am getting error in NLicenseObtainComponents();
So,
What is right way to obtain components after loading .LIC file?
Is it necessary to have net connectivity for NLicenseObtainComponents()? What if I don't have constant net connectivity?
Do I need to add .LIC file on every app launch ? if not what is right way to do it?

Thanks
pratikxeb
 
Posts: 13
Joined: Dec 19, 2015 08:47

Re: Activating Licence for IOS device

Postby MartynasV » Jan 07, 2016 12:55

pratikxeb wrote:Hello,
I am using iOS v8.4
NLicenseAddN() this function worked perfectly, without an error. So license is loaded in memory.
My code flow is as follow:
Code: Select all
result = NStringCreate(N_T(filepath), &file);
result = NFileReadAllTextN(file, &license);
result = NLicenseAddN(license);
result = NLicenseObtainComponents(N_T("/local"), N_T("5000"), components, &available);

I have written this code on app launch.

When device is connected to Internet, NLicenseObtainComponents() works successfully.
Now, there is no Internet connectivity on device and I relaunch the app.
In this case, I am getting error in NLicenseObtainComponents();
So,
What is right way to obtain components after loading .LIC file?
Is it necessary to have net connectivity for NLicenseObtainComponents()? What if I don't have constant net connectivity?
Do I need to add .LIC file on every app launch ? if not what is right way to do it?

Thanks

Hello,

What is right way to obtain components after loading .LIC file?

Code: Select all
result = NLicenseObtainComponents(N_T("/local"), N_T("5000"), components, &available);


Is it necessary to have net connectivity for NLicenseObtainComponents()?

Yes.

What if I don't have constant net connectivity?

Answer:
MartynasV wrote:
pratikxeb wrote: One more thing I want to add in this, After loading license to memory, do I need internet connection for further operation?

Yes, internet license tries to communicate with our server every 30 minutes, if it fails, license stops working until successful connection is made again.


Do I need to add .LIC file on every app launch ? if not what is right way to do it?

When you start app you need to obtain components, to obtain licenses has to be found, so you need to add those licenses.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 258
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: Activating Licence for IOS device

Postby pratikxeb » Jan 08, 2016 05:17

MartynasV wrote:
pratikxeb wrote:Hello,
I am using iOS v8.4
NLicenseAddN() this function worked perfectly, without an error. So license is loaded in memory.
My code flow is as follow:
Code: Select all
result = NStringCreate(N_T(filepath), &file);
result = NFileReadAllTextN(file, &license);
result = NLicenseAddN(license);
result = NLicenseObtainComponents(N_T("/local"), N_T("5000"), components, &available);

I have written this code on app launch.

When device is connected to Internet, NLicenseObtainComponents() works successfully.
Now, there is no Internet connectivity on device and I relaunch the app.
In this case, I am getting error in NLicenseObtainComponents();
So,
What is right way to obtain components after loading .LIC file?
Is it necessary to have net connectivity for NLicenseObtainComponents()? What if I don't have constant net connectivity?
Do I need to add .LIC file on every app launch ? if not what is right way to do it?

Thanks

Hello,

What is right way to obtain components after loading .LIC file?

Code: Select all
result = NLicenseObtainComponents(N_T("/local"), N_T("5000"), components, &available);


Is it necessary to have net connectivity for NLicenseObtainComponents()?

Yes.

What if I don't have constant net connectivity?

Answer:
MartynasV wrote:
pratikxeb wrote: One more thing I want to add in this, After loading license to memory, do I need internet connection for further operation?

Yes, internet license tries to communicate with our server every 30 minutes, if it fails, license stops working until successful connection is made again.


Do I need to add .LIC file on every app launch ? if not what is right way to do it?

When you start app you need to obtain components, to obtain licenses has to be found, so you need to add those licenses.

Hello,

Thank you for details.
That means, code flow for trial license and Internet license is same, as they both required net connectivity.
Is there any other type of license for iOS, that does not required net connectivity once it have been activated?
Does Enterprise license suitable for my requirement?

I didn't fount any details of some functions like NLicenseAddN(), NImageSaveToMemoryN() etc in the documentation.
Also, is there any specific documentation regarding license activation procedure and details of such functions?

Thank you
Last edited by pratikxeb on Jan 14, 2016 06:10, edited 2 times in total.
pratikxeb
 
Posts: 13
Joined: Dec 19, 2015 08:47

Re: Activating Licence for IOS device

Postby MartynasV » Jan 13, 2016 13:21

pratikxeb wrote:Hello,

Thank you for details.
That means code flow for trial license and Internet license in same, as they both required net connectivity.
Is there any other type of license for iOS, that does not required net connectivity once it have been activated?
Does Enterprise license suitable for my requirement?

I didn't fount any details of some functions like NLicenseAddN(), NImageSaveToMemoryN() etc in the documentation.
Also, is there any specific documentation regarding license activation procedure and details of such functions?

Thank you

Hello,

That means code flow for trial license and Internet license in same, as they both required net connectivity.
Is there any other type of license for iOS, that does not required net connectivity once it have been activated?

No, not for now.

Does Enterprise license suitable for my requirement?

About Enterprise licenses please contact Irmantas Naujikas irmantas@neurotechnology.com.

I didn't fount any details of some functions like NLicenseAddN(), NImageSaveToMemoryN() etc in the documentation.

Yes, they are missing from our documentation, they will be put in.

Also, is there any specific documentation regarding license activation procedure and details of such functions?

"SDK\Documentation\Activation.pdf"
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 258
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: Activating Licence for IOS device

Postby kmaltz » Feb 19, 2016 20:20

Hello.
Below is the code that I have been testing to get the license information. The license file starts with a colon that is followed by a long string of numbers.
Code: Select all
        NResult result;
        NSString *extractorFile = @"Cayen_FingerExtractor_iOS_22000_10100";
       
        // retrieve a license string from a resource file
        NSString *txtFilePath = [[NSBundle mainBundle] pathForResource:extractorFile ofType:@"lic"];
        NSString *license = [NSString stringWithContentsOfFile:txtFilePath encoding:NSUTF8StringEncoding error:NULL];
        const char *cStringLicense = [license cStringUsingEncoding:NSASCIIStringEncoding];
       
        // First attempt at getting license information
        HNString file;
        HNString nLic;
        result = NStringCreate([txtFilePath cStringUsingEncoding:NSASCIIStringEncoding], &file);
        result = NFileReadAllTextN(file, &nLic);
        NSString *returnString = [BiometricsLayer stringFromHNString:nLic];
        // this returned N_E_FORMAT
        result = NLicenseAddN(nLic);


This is some additional code that I am trying, but is also returning unexpected results. I believe this could be due to the issues that I have experienced with the code above, but this must also ultimately work.

Code: Select all
        // this returned N_E_NOT_SUPPORTED
        HNLicenseInfo hLicenseInfo;
        result = NLicenseGetLicenseInfoOnlineA(cStringLicense, &hLicenseInfo);
        //NRESULT_CHECK(nResult);       
       
        NSString *components = @"Devices.FingerScanners";
        const char *cStringCompponents = [components cStringUsingEncoding:NSASCIIStringEncoding];
       
        // this returned N_OK but object was null
        result = NLicenseGetObtainedLicenseInfoForComponentA(cStringCompponents, &hLicenseInfo);
        NRESULT_CHECK(result);


Any assistance would be appreciated.
kmaltz
 
Posts: 2
Joined: Feb 19, 2016 19:51

Re: Activating Licence for IOS device

Postby kmaltz » Feb 19, 2016 20:31

Hello. I am attempting to write the code that will license my iOS device. The following code returns unexpected results:
Code: Select all
        NResult result;
        NSString *extractorFile = @"Cayen_FingerExtractor_iOS_22000_10100";
       
        // retrieve a license string from a resource file
        NSString *txtFilePath = [[NSBundle mainBundle] pathForResource:extractorFile ofType:@"lic"];
        NSString *license = [NSString stringWithContentsOfFile:txtFilePath encoding:NSUTF8StringEncoding error:NULL];
        const char *cStringLicense = [license cStringUsingEncoding:NSASCIIStringEncoding];
       
        HNString file;
        HNString nLic;
        result = NStringCreate([txtFilePath cStringUsingEncoding:NSASCIIStringEncoding], &file);
        result = NFileReadAllTextN(file, &nLic);
        NSString *returnString = [BiometricsLayer stringFromHNString:nLic];
      // this returned N_E_FORMAT
        result = NLicenseAddN(nLic);

Next, we are attempting to execute the following code in order to identify the components that are licensed:
Code: Select all
// this returned N_E_NOT_SUPPORTED
        HNLicenseInfo hLicenseInfo;
        result = NLicenseGetLicenseInfoOnlineA(cStringLicense, &hLicenseInfo);
        //NRESULT_CHECK(nResult);
       
        NSString *components = @"Devices.FingerScanners";
        const char *cStringCompponents = [components cStringUsingEncoding:NSASCIIStringEncoding];
       
        // this returned N_OK but object was null
        result = NLicenseGetObtainedLicenseInfoForComponentA(cStringCompponents, &hLicenseInfo);
        NRESULT_CHECK(result);


Any insight would be appreciated.
kmaltz
 
Posts: 2
Joined: Feb 19, 2016 19:51

Re: Activating Licence for IOS device

Postby Martynas » Feb 23, 2016 08:13

kmaltz wrote:Hello. I am attempting to write the code that will license my iOS device. The following code returns unexpected results:
Code: Select all
        NResult result;
        NSString *extractorFile = @"Cayen_FingerExtractor_iOS_22000_10100";
       
        // retrieve a license string from a resource file
        NSString *txtFilePath = [[NSBundle mainBundle] pathForResource:extractorFile ofType:@"lic"];
        NSString *license = [NSString stringWithContentsOfFile:txtFilePath encoding:NSUTF8StringEncoding error:NULL];
        const char *cStringLicense = [license cStringUsingEncoding:NSASCIIStringEncoding];
       
        HNString file;
        HNString nLic;
        result = NStringCreate([txtFilePath cStringUsingEncoding:NSASCIIStringEncoding], &file);
        result = NFileReadAllTextN(file, &nLic);
        NSString *returnString = [BiometricsLayer stringFromHNString:nLic];
      // this returned N_E_FORMAT
        result = NLicenseAddN(nLic);

Next, we are attempting to execute the following code in order to identify the components that are licensed:
Code: Select all
// this returned N_E_NOT_SUPPORTED
        HNLicenseInfo hLicenseInfo;
        result = NLicenseGetLicenseInfoOnlineA(cStringLicense, &hLicenseInfo);
        //NRESULT_CHECK(nResult);
       
        NSString *components = @"Devices.FingerScanners";
        const char *cStringCompponents = [components cStringUsingEncoding:NSASCIIStringEncoding];
       
        // this returned N_OK but object was null
        result = NLicenseGetObtainedLicenseInfoForComponentA(cStringCompponents, &hLicenseInfo);
        NRESULT_CHECK(result);


Any insight would be appreciated.

Hello,

please write an email to support@neurotechnology.com.
Best regards,

Martynas
Software Consultant
Neurotechnology
Martynas
Neurotechnology
 
Posts: 2192
Joined: Sep 19, 2008 10:02
Location: Vilnius, Lithuania

iOS sample in Swift

Postby ezio_auditore » Mar 03, 2016 18:48

Hi,

I am fairly new to iOS development and I am trying out the 30 day version. I was wondering if there are any tutorials/examples out there that can help translate the existing sample to a swift app. Has anyone ever tried it?

Admin: merged to "iOS related questions"
ezio_auditore
 
Posts: 1
Joined: Mar 03, 2016 18:39

Re: iOS sample in Swift

Postby vaidasz » Mar 07, 2016 16:02

ezio_auditore wrote:Hi,

I am fairly new to iOS development and I am trying out the 30 day version. I was wondering if there are any tutorials/examples out there that can help translate the existing sample to a swift app. Has anyone ever tried it?


Hello,

Unfortunately, but there is only one sample application provided with SDK that shows how to use SDK functionality. The sample could be found at Neurotec_Biometric_6_0_SDK_Trial\Samples\Biometrics\iOS.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 559
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Trying out Biometrics for iOS

Postby zmicierp » Apr 13, 2016 14:57

Hello,

I"m currently exploring VeriLook SDK capabilities and its efficiency for extracting and matching people"s faces while running on a mobile device. I"ve noticed that the only sample app for iOS which comes with 6.0 SDK Trial is writing images to a file before processing it. Obviously, I want to exclude this step by passing in-memory image directly to the engine. As I can grasp from documentation, the framework does support sample buffers, and we could get a buffer from iOS camera devices in almost no time (there are several types we can operate with - CMSampleBuffer, CVImageBuffer, CVPixelBuffer, etc).
Could someone please shed some light on how exactly are we supposed to feed Biometric engine with image buffers? What image formats are supported already? There is NBiometricSetSampleBuffer API that can be called for a HNFace object, but it seems to be not documented yet...

Thanks in advance.

Admin: merged to "iOS related questions"
zmicierp
 
Posts: 1
Joined: Apr 13, 2016 12:49

Re: Trying out Biometrics for iOS

Postby vaidasz » Apr 15, 2016 13:15

zmicierp wrote:Hello,

I"m currently exploring VeriLook SDK capabilities and its efficiency for extracting and matching people"s faces while running on a mobile device. I"ve noticed that the only sample app for iOS which comes with 6.0 SDK Trial is writing images to a file before processing it. Obviously, I want to exclude this step by passing in-memory image directly to the engine. As I can grasp from documentation, the framework does support sample buffers, and we could get a buffer from iOS camera devices in almost no time (there are several types we can operate with - CMSampleBuffer, CVImageBuffer, CVPixelBuffer, etc).
Could someone please shed some light on how exactly are we supposed to feed Biometric engine with image buffers? What image formats are supported already? There is NBiometricSetSampleBuffer API that can be called for a HNFace object, but it seems to be not documented yet...

Thanks in advance.


Hello,

You need to pass a buffer with image data to NBiometricSetSampleBuffer. The supported image formats are BMP, JPEG, Lossless JPEG, JPEG 2000, PNG, TIFF and WSQ.
Here is the modification of 'extractFaces' function to use image directly:
Code: Select all
-(void)extractFaces:(UIImage*)image{
    NSData *pngData = UIImagePNGRepresentation(image);
    HNSubject hSubject = NULL;
    HNFace hFace = NULL;
    HNBuffer hImageData = NULL;
    void * imageDataPtr = NULL;
    @try {
        NRESULT_CHECK(NSubjectCreate(&hSubject));
        NRESULT_CHECK(NFaceCreate(&hFace));
        NRESULT_CHECK(NBufferCreate([pngData length], &hImageData));
        NRESULT_CHECK(NBufferGetPtr(hImageData, &imageDataPtr));
        [pngData getBytes:imageDataPtr length:[pngData length]];
        NRESULT_CHECK(NBiometricSetSampleBuffer(hFace, hImageData));
        NRESULT_CHECK(NSubjectAddFace(hSubject, hFace, NULL));
        NRESULT_CHECK(NSubjectSetMultipleSubjects(hSubject, true));
        NRESULT_CHECK(NObjectSet(hSubject, &lastOperationSubject));
        if (!extractSubject(biometricClient, hSubject)) [self callDelegateForExtractionSuccess:[NSNumber numberWithBool:false]];
    }
    @catch (NSException *exception) {
        [self callDelegateForExtractionSuccess:false];
    }
    @finally {
        NObjectSet(NULL, &hImageData);
        NObjectSet(NULL, &hFace);
        NObjectSet(NULL, &hSubject);
    }
}
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 559
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: C++ related questions

Postby Max Hall » Apr 29, 2016 21:23

I"m experiencing a similar situation where I require the ability to pass in a monochrome byte array into NBiometricSetSampleBuffer rather than calling NBiometricSetFileName. I"ve noticed the snippet of code provided for iOS. Can you please show me or point me to an example of this in C++?
Thanks!
Max Hall
 
Posts: 1
Joined: Apr 29, 2016 21:17

Re: iOS related questions

Postby Martynas » May 02, 2016 07:37

Max Hall wrote:I"m experiencing a similar situation where I require the ability to pass in a monochrome byte array into NBiometricSetSampleBuffer rather than calling NBiometricSetFileName. I"ve noticed the snippet of code provided for iOS. Can you please show me or point me to an example of this in C++?
Thanks!

Hi,

isn't the snippet provided for iOS working in your case?
Basically what you need to do is to create the NBuffer from the image in memory and set this NBuffer to NFace, by using NBiometricSetSampleBuffer function.
Best regards,

Martynas
Software Consultant
Neurotechnology
Martynas
Neurotechnology
 
Posts: 2192
Joined: Sep 19, 2008 10:02
Location: Vilnius, Lithuania

Re: iOS related questions

Postby racroi3010 » Nov 17, 2016 11:37

I tried to use NBiometricSetSampleBuffer instead of NBiometricSetFileName, but it"s always error at NBiometricEngineCreateTemplate
NBiometricEngineCreateTemplate() failed (result = -33)!
NError[4679]: [TID: 2986926080] (-33) One or more errors occurred
---> InnerError[0]: (-10) hFileName is NULL or an empty string
Param: hFileName<---


Please help, thanks in advance!
racroi3010
 
Posts: 3
Joined: Nov 17, 2016 11:08

Re: iOS related questions

Postby Martynas » Nov 17, 2016 15:15

Hi,

please provide the code snippet, which would show how you performing the setting of the buffer and where it could be seen how the template creation is done.
Best regards,

Martynas
Software Consultant
Neurotechnology
Martynas
Neurotechnology
 
Posts: 2192
Joined: Sep 19, 2008 10:02
Location: Vilnius, Lithuania

Re: iOS related questions

Postby racroi3010 » Nov 18, 2016 04:02

Thank you for promptly rely, below is my implementation. The image is loaded by using OpenCV, then a HNBuffer is initialized with image data. Please check it if there is any wrong setting.

Code: Select all
    // create subject
    result = NSubjectCreate(&hSubject);
    if (NFailed(result))
    {
        result = PrintErrorMsgWithLastError(N_T("NSubjectCreate() failed (result = %d)!"), result);
        goto FINALLY;
    }

    // create face for the subject
    result = NFaceCreate(&hFace);
    if (NFailed(result))
    {
        result = PrintErrorMsgWithLastError(N_T("NFaceCreate() failed (result = %d)!"), result);
        goto FINALLY;
    }

    // set data
    {
        cv::Mat frame = cv::imread(argv[1], CV_LOAD_IMAGE_COLOR);


        HNBuffer hImageData = NULL;
        void * imgDataPtr = NULL;
        int size = frame.channels() * frame.cols * frame.rows;

        NBufferCreate(size, &hImageData);
        NBufferGetPtr(hImageData, &imgDataPtr);
        memcpy(imgDataPtr, frame.data, size);


        result = NBiometricSetSampleBuffer(hFace, hImageData);

    }

    if (NFailed(result))
    {
        result = PrintErrorMsgWithLastError(N_T("NBiometricSetFileNameN() failed (result = %d)!"), result);
        goto FINALLY;
    }

    // set the face for the subject
    result = NSubjectAddFace(hSubject, hFace, NULL);
    if (NFailed(result))
    {
        result = PrintErrorMsgWithLastError(N_T("NSubjectAddFace() failed (result = %d)!"), result);
        goto FINALLY;
    }


    // create biometric client
    result = NBiometricClientCreate(&hBiometricClient);
    if (NFailed(result))
    {
        result = PrintErrorMsgWithLastError(N_T("NBiometricClientCreate() failed (result = %d)!"), result);
        goto FINALLY;
    }

    {
        NTemplateSize templateSize = ntsLarge;
        NBoolean parameter = NTrue;
        NBool hasEx = NFalse;

        // set template size to large
        result = NObjectSetPropertyP(hBiometricClient, N_T("Faces.TemplateSize"), N_TYPE_OF(NTemplateSize), naNone, &templateSize, sizeof(templateSize), 1, NTrue);
        if (NFailed(result))
        {
            result = PrintErrorMsgWithLastError(N_T("NObjectSetProperty() failed (result = %d)!"), result);
            goto FINALLY;
        }

        result = NLicenseIsComponentActivated(additionalComponents, &hasEx);
        if (NFailed(result))
        {
            result = PrintErrorMsgWithLastError(N_T("NLicenseIsComponentActivated() failed (result = %d)!"), result);
            goto FINALLY;
        }

        if (hasEx)
        {
            // set detect all facial features
            result = NObjectSetPropertyP(hBiometricClient, N_T("Faces.DetectAllFeaturePoints"), N_TYPE_OF(NBoolean), naNone, &parameter, sizeof(parameter), 1, NTrue);
            if (NFailed(result))
            {
                result = PrintErrorMsgWithLastError(N_T("NObjectSetProperty() failed (result = %d)!"), result);
                goto FINALLY;
            }
        }
    }

    // create the template
    result = NBiometricEngineCreateTemplate(hBiometricClient, hSubject, &biometricStatus);
    if (NFailed(result))
    {
        result = PrintErrorMsgWithLastError(N_T("NBiometricEngineCreateTemplate() failed (result = %d)!"), result);
        goto FINALLY;
    }
racroi3010
 
Posts: 3
Joined: Nov 17, 2016 11:08

Re: iOS related questions

Postby Martynas » Nov 18, 2016 13:17

The first thing, which I need to mention, that only a one dimension array of images bytes is supported. And OpenCV Mat is a multidimensional array.
So it happens, that engine tries to use the sample you have set and fails, then it tries to use the FileName and as it is empty, then it throws the error.
Next, SetSampelBuffer should be set only with the bytes of the image, which contains the image format. It is similar to FileName function, where you pass the name of the file and the SDK reads its all content.
So SetSampelBuffer shouldn’t be supplied with the RAW bytes or some pointers to file itself or the pointers to some internal file arrays. You need to have a full image buffer.
If there is a need to use a RAW image, then you need to create the NImage from it first of all, by using the NImageCreateFromData, passing the format of the RAW image and pixels to this function. And then set the image to NFace by using NFaceSetImage function.
Best regards,

Martynas
Software Consultant
Neurotechnology
Martynas
Neurotechnology
 
Posts: 2192
Joined: Sep 19, 2008 10:02
Location: Vilnius, Lithuania

Re: iOS related questions

Postby panky8070 » Jan 20, 2017 20:42

HI,
I am experiencing an issue while getting licensing components , i started the pgd utility as per the activation document. The process is running but when I am trying sample app is it throwing error from this peace of code
Code: Select all
 result = NLicenseObtainComponents(serverAddress, serverPort, components[i], &available);
 if (NFailed(result))
  {
            NSLog(@"NLicenseObtainComponents() failed (result = %d)!", result);
            return false;
  }

And I am getting -31 error code. I am running the trail version of sdk. Can anyone help me with issue ?

Regards,
Pankaj
panky8070
 
Posts: 2
Joined: Aug 10, 2016 14:28

Re: iOS related questions

Postby MartynasV » Jan 23, 2017 11:45

panky8070 wrote:HI,
I am experiencing an issue while getting licensing components , i started the pgd utility as per the activation document. The process is running but when I am trying sample app is it throwing error from this peace of code
Code: Select all
 result = NLicenseObtainComponents(serverAddress, serverPort, components[i], &available);
 if (NFailed(result))
  {
            NSLog(@"NLicenseObtainComponents() failed (result = %d)!", result);
            return false;
  }

And I am getting -31 error code. I am running the trail version of sdk. Can anyone help me with issue ?

Regards,
Pankaj

Hello,

-31 is socket error, make sure that pserver.neurotechnology.com port 80 is not blocked. If you want to obtain licenses from local pgd service, then values should be "/local" and 5000 for variables serverAddress and serverPort, if with these values you still experience the same error, then generate diagnostics and send with issue description to support@neurotechnology.com .
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 258
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: iOS related questions

Postby silvavelosa » Nov 15, 2017 16:40

Hello,

we are trying to implement the active face liveness detection in an IOS app. We have noticed that the current IOS sample doesn"t support this feature, as it just sends the captured image to the biometric client and extracts the template from it.

Has anyone done an implementation supporting face liveness detection in IOS?

We also have noticed WX library has little to no support for IOS, and most of the NGUI components depend on it. Has anyone tried to use an NFaceView or any similar wx based object in IOS?

Best regards,
Jaime Silva
silvavelosa
 
Posts: 1
Joined: Nov 15, 2017 16:29

Re: iOS related questions

Postby MartynasV » Nov 20, 2017 10:11

silvavelosa wrote:Hello,

we are trying to implement the active face liveness detection in an IOS app. We have noticed that the current IOS sample doesn"t support this feature, as it just sends the captured image to the biometric client and extracts the template from it.

Has anyone done an implementation supporting face liveness detection in IOS?

We also have noticed WX library has little to no support for IOS, and most of the NGUI components depend on it. Has anyone tried to use an NFaceView or any similar wx based object in IOS?

Best regards,
Jaime Silva

Hello Jaime,

Yes, currently "SDK\Samples\Biometrics\iOS\Biometrics" sample doesn't have liveness feature turned on, you will have to do it yourself.

You set liveness mode on NBiometricClient using following function, as you may see from SDK\Frameworks\iOS\NBiometrics.framework\Headers\Biometrics\NBiometricEngine.hpp:
Code: Select all
void SetFacesLivenessMode(NLivenessMode value)
{
                SetProperty(N_T("Faces.LivenessMode"), value);
}
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 258
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 4 guests

cron