locked
What's wrong with 'source not found'? RRS feed

  • Question

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


    Wednesday, October 7, 2020 9:06 AM

Answers

  • The trouble came from wrong data for args[0] and args[1]. They should be a.jpg and b.jpg, but they were named wrongly as a.jpg.jpg & b.jpg.jpg.
    Wednesday, October 7, 2020 11:16 AM

All replies

  • Maybe you did not specify any argument for args[0] and args[1] (then perhaps replace this with corresponding constant strings) or also ask for assistance the authors of this library.


    • Edited by Viorel_MVP Wednesday, October 7, 2020 9:35 AM
    Wednesday, October 7, 2020 9:34 AM
  • I just checked it and confirmed that both args[0/1] are valid values. I can't contact with the library author.
    Wednesday, October 7, 2020 9:40 AM
  • The trouble came from wrong data for args[0] and args[1]. They should be a.jpg and b.jpg, but they were named wrongly as a.jpg.jpg & b.jpg.jpg.
    Wednesday, October 7, 2020 11:16 AM