Throws Neurotec.NotActivatedException

General information about Neurotechnology and its software

Throws Neurotec.NotActivatedException

Postby mprasanna » Sep 14, 2017 18:08

I was developing an application following the sample SimpleFacesSamplesCS. I wrote the code similar what is there in EnrollFromCamera. I can run the sample using VS2012 and the components needed shows green. When I run my program, during _biometricClient.EndCapture(ar) call I get Neurotec.NotActivatedException. Please help resolve the issue. I am not sure what should I do resolve the issue. I can share the sample program if required.

Thanks and regards
Prasanna
mprasanna
 
Posts: 10
Joined: Aug 22, 2017 13:23

Re: Throws Neurotec.NotActivatedException

Postby vaidasz » Sep 15, 2017 06:47

mprasanna wrote:I was developing an application following the sample SimpleFacesSamplesCS. I wrote the code similar what is there in EnrollFromCamera. I can run the sample using VS2012 and the components needed shows green. When I run my program, during _biometricClient.EndCapture(ar) call I get Neurotec.NotActivatedException. Please help resolve the issue. I am not sure what should I do resolve the issue. I can share the sample program if required.

Thanks and regards
Prasanna


Hello Prasanna,

If you use SDK structure, the licenses must be placed at SDK\Bin\Licenses or at the same folder where application startup path is. If you moved the sample out of the SDK structure or developed you application, copy the licenses you want to use to the same folder where application startup folder is.
It is not a must to have the licenses at the application startup folder. You could load the licenses in the source code by using NLicense.Add(LICENSE_READ_AS_STRING) when developing your application.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 580
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Throws Neurotec.NotActivatedException

Postby mprasanna » Sep 15, 2017 13:44

As suggested, I added the following code in Load event.

Code: Select all
NLicense.Add("Biometrics.FaceDetection");
NLicense.Add("Biometrics.FaceExtraction");
NLicense.Add("Devices.Cameras");


After that I am getting the following exception.
{"License is invalid or unsupported\r\nParameter name: hLicense"}

Please help resolve the issue.

Thanks
Prasanna
mprasanna
 
Posts: 10
Joined: Aug 22, 2017 13:23

Re: Throws Neurotec.NotActivatedException

Postby mprasanna » Sep 17, 2017 18:01

Update in the issue:

After adding the following code, I could proceed further.
Code: Select all
            const string Components = "Biometrics.FaceExtraction,Biometrics.FaceMatching,Biometrics.FaceDetection,Devices.Cameras,Biometrics.FaceSegmentsDetection";
            foreach (string component in Components.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                NLicense.ObtainComponents(LicenseUtil.Address, LicenseUtil.Port, component);
            }


But while extracting on the call biometricClient.ForceStart() I got the exception Neurotec.NAggregateException. Below is the stack trace for the exception.

at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.NAsyncOperation.get_Result()
at Neurotec.NAsyncOperation`1.get_Result()
at Neurotec.NAsyncResult.End[T](IAsyncResult asyncResult)
at Neurotec.Biometrics.Client.NBiometricClient.EndCapture(IAsyncResult asyncResult)


Please help resolve the issue. If I run the sample it runs fine without any exception.

Thanks and regards
Prasanna
mprasanna
 
Posts: 10
Joined: Aug 22, 2017 13:23

Re: Throws Neurotec.NotActivatedException

Postby vaidasz » Sep 18, 2017 06:59

mprasanna wrote:As suggested, I added the following code in Load event.

Code: Select all
NLicense.Add("Biometrics.FaceDetection");
NLicense.Add("Biometrics.FaceExtraction");
NLicense.Add("Devices.Cameras");


After that I am getting the following exception.
{"License is invalid or unsupported\r\nParameter name: hLicense"}

Please help resolve the issue.

Thanks
Prasanna


Hello,

You are trying to load components which is incorrect. These components must be used with NLicense.ObtainComponents() method.
You need to pass license file read as string dor NLicense.Add() method. You could use NLicense.Add(File.ReadAllText(PATH_TO_LICENSE)).

mprasanna wrote:Update in the issue:

After adding the following code, I could proceed further.
Code: Select all
            const string Components = "Biometrics.FaceExtraction,Biometrics.FaceMatching,Biometrics.FaceDetection,Devices.Cameras,Biometrics.FaceSegmentsDetection";
            foreach (string component in Components.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                NLicense.ObtainComponents(LicenseUtil.Address, LicenseUtil.Port, component);
            }


But while extracting on the call biometricClient.ForceStart() I got the exception Neurotec.NAggregateException. Below is the stack trace for the exception.

at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.NAsyncOperation.get_Result()
at Neurotec.NAsyncOperation`1.get_Result()
at Neurotec.NAsyncResult.End[T](IAsyncResult asyncResult)
at Neurotec.Biometrics.Client.NBiometricClient.EndCapture(IAsyncResult asyncResult)


Please help resolve the issue. If I run the sample it runs fine without any exception.

Thanks and regards
Prasanna


In this example you use components correctly. But you need to ensure you have required license first - either copy it to the same folder as your application startup folder is or load it using NLicense.Add().
The exception message you specified is incomplete. Please provide full exception message.
By the way, NLicense.ObtainComponents() returns bool value so you could use: bool isObtained = NLicense.ObtainComponents().
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 580
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Throws Neurotec.NotActivatedException

Postby mprasanna » Sep 18, 2017 19:25

Like the sample, I have two buttons one for starting the camera and one for extracting face template. On start button click it works fine and shows the image. But on click if extract the exception is thrown. I am calling
Code: Select all
biometricClient.ForceStart();
on extract button click.

Here is the complete stack trace from the exception object.
at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.NAsyncOperation.get_Result()
at Neurotec.NAsyncOperation`1.get_Result()
at Neurotec.NAsyncResult.End[T](IAsyncResult asyncResult)
at Neurotec.Biometrics.Client.NBiometricClient.EndCapture(IAsyncResult asyncResult)
at SampleFaceDetect.EnrollFromCamera.OnCapturingCompleted(IAsyncResult ar) in d:\Projects\SampleFaceDetect\SampleFaceDetect\EnrollFromCamera.cs:line 75


If I run or even modify the code of sample and run, there are no errors.
mprasanna
 
Posts: 10
Joined: Aug 22, 2017 13:23

Re: Throws Neurotec.NotActivatedException

Postby vaidasz » Sep 19, 2017 12:50

mprasanna wrote:Like the sample, I have two buttons one for starting the camera and one for extracting face template. On start button click it works fine and shows the image. But on click if extract the exception is thrown. I am calling
Code: Select all
biometricClient.ForceStart();
on extract button click.

Here is the complete stack trace from the exception object.
at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.NAsyncOperation.get_Result()
at Neurotec.NAsyncOperation`1.get_Result()
at Neurotec.NAsyncResult.End[T](IAsyncResult asyncResult)
at Neurotec.Biometrics.Client.NBiometricClient.EndCapture(IAsyncResult asyncResult)
at SampleFaceDetect.EnrollFromCamera.OnCapturingCompleted(IAsyncResult ar) in d:\Projects\SampleFaceDetect\SampleFaceDetect\EnrollFromCamera.cs:line 75


If I run or even modify the code of sample and run, there are no errors.


Hello,

You specified StackTrace. Please specify Message of exception you get.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 580
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Throws Neurotec.NotActivatedException

Postby ArtificialInsights » Jan 22, 2018 14:28

For people that are new to using Neurotechnology Biometrics, the documentation can be very hard to understand. When it was written, I think the writers should have taken a better approach with examples and explanations in the manual, instead of simply referring to the samples and tutorials.

When you are setting up your application, you must copy all of the files from SDK/Bin/Win32_x86 or SDK/Bin/Win64_x64 into the debug folder or your application. To do this, create the application, then run it. Exit out and then the debug folder will exist. Then, you need to reference all the .dll files found in SDK/Bin/dotNET in Visual Studio (Right click on References, Add References)

Once this is complete, add the following to the top of the application:

Code: Select all
using Neurotec.Biometrics;
using Neurotec.Biometrics.Client;
using Neurotec.Licensing;


Then, add this line to the main class:

Code: Select all
const string Components = "Biometrics.FingerExtraction,Biometrics.FingerMatching";


Add all necessary license function to that line.

Next, you need to add the License Information and obtain the license. Add this to the applications main constructor so it runs when the application is initialized:

Code: Select all
            // Fingerprint Client
            NLicense.Add(":0000000 ... DF1C78"); // Long line of characters found inside the License file, starts with a :
            // Fingerprint Matcher
            NLicense.Add(":0000000 ... F31C66"); // Long line of characters found inside the License file, starts with a :

                // Obtain license
                if (!NLicense.ObtainComponents("/local", 5000, Components))
                {
                    throw new ApplicationException(
                        string.Format("Could not obtain licenses for components: {0}", Components));
                }


And thats it, in a nutshell. In this example, I am assuming you are using Visual Studio with C#... but the basics will apply to just about everything I think.
Hope this helps...
ArtificialInsights
 
Posts: 4
Joined: May 19, 2017 00:38


Return to Public

Who is online

Users browsing this forum: No registered users and 2 guests