S
Stan Huang at Taiwan
Guest
Below is snippet of my program. I built it successfully and ran it. I got 'source not found' error. How come?
The exception occurred once executing line of "NBiometricStatus status = biometricClient.Verify(referenceSubject, candidateSubject);"; where biometricClient.Verify() is a function from DLL.
---------------------- program snippet below -----------------
static int Main(string[] args)
{
try
{
// Obtain licenses
if (!NLicense.Obtain("/local", 5000, licenses))
{
throw new ApplicationException(string.Format("Could not obtain licenses: {0}", licenses));
}
using (var biometricClient = new NBiometricClient())
// Create subjects with face object
using (NSubject referenceSubject = CreateSubject(args[0], args[0]))
using (NSubject candidateSubject = CreateSubject(args[1], args[1]))
{
// Set matching threshold
biometricClient.MatchingThreshold = 48;
// Set matching speed
biometricClient.FacesMatchingSpeed = NMatchingSpeed.Low;
// Verify subjects
NBiometricStatus status = biometricClient.Verify(referenceSubject, candidateSubject);
if (status == NBiometricStatus.Ok || status == NBiometricStatus.MatchNotFound)
{
int score = referenceSubject.MatchingResults[0].Score;
Console.Write("Image scored {0}, verification ", score);
Console.WriteLine(status == NBiometricStatus.Ok ? "succeeded" : "failed");
}
else
{
Console.Write("Verification failed. Status: {0}", status);
return -1;
}
}
return 0;
}
catch (Exception ex)
{
return TutorialUtils.PrintException(ex);
}
}
Continue reading...
The exception occurred once executing line of "NBiometricStatus status = biometricClient.Verify(referenceSubject, candidateSubject);"; where biometricClient.Verify() is a function from DLL.
---------------------- program snippet below -----------------
static int Main(string[] args)
{
try
{
// Obtain licenses
if (!NLicense.Obtain("/local", 5000, licenses))
{
throw new ApplicationException(string.Format("Could not obtain licenses: {0}", licenses));
}
using (var biometricClient = new NBiometricClient())
// Create subjects with face object
using (NSubject referenceSubject = CreateSubject(args[0], args[0]))
using (NSubject candidateSubject = CreateSubject(args[1], args[1]))
{
// Set matching threshold
biometricClient.MatchingThreshold = 48;
// Set matching speed
biometricClient.FacesMatchingSpeed = NMatchingSpeed.Low;
// Verify subjects
NBiometricStatus status = biometricClient.Verify(referenceSubject, candidateSubject);
if (status == NBiometricStatus.Ok || status == NBiometricStatus.MatchNotFound)
{
int score = referenceSubject.MatchingResults[0].Score;
Console.Write("Image scored {0}, verification ", score);
Console.WriteLine(status == NBiometricStatus.Ok ? "succeeded" : "failed");
}
else
{
Console.Write("Verification failed. Status: {0}", status);
return -1;
}
}
return 0;
}
catch (Exception ex)
{
return TutorialUtils.PrintException(ex);
}
}
Continue reading...