Page 1 of 1

Error Initilaizing Camera

PostPosted: Dec 01, 2017 17:23
by gtoledo
Hi,

I'm trying to do face recognition on different machines. On most of them everything works fine, but on several Windows 10 Pro Machines i'm having an error when we try to begin the camera capture. This is the error i get on the eventviewer

Nombre de la aplicación con errores: TestDeviceManager.exe, versión: 1.0.0.0, marca de tiempo: 0x5a2065a7
Nombre del módulo con errores: Windows.Media.dll, versión: 10.0.16299.64, marca de tiempo: 0xd02a0cd6
Código de excepción: 0xc0000005
Desplazamiento de errores: 0x0038a8dd
Identificador del proceso con errores: 0x2598
Hora de inicio de la aplicación con errores: 0x01d36ac6f992c778
Ruta de acceso de la aplicación con errores: C:\Users\USER\Desktop\DeviceTeste\TestDeviceManager.exe
Ruta de acceso del módulo con errores: C:\Windows\System32\Windows.Media.dll
Identificador del informe: cd0e4d48-c18f-4ed3-8c44-be71628fc172
Nombre completo del paquete con errores:
Identificador de aplicación relativa del paquete con errores:


The code where it happens is the following:

Code: Select all
 private void ConfigurarEjecutarExtraccion()
        {
            try
            {
           _biometricClient = new NBiometricClient
            {
                BiometricTypes = NBiometricType.Face,
                UseDeviceManager = true
            };
            Trace.WriteLine("Inicializar Camara");
            _biometricClient.Initialize();
            _biometricClient.FaceCaptureDevice = camera;
           

                _biometricClient.FacesConfidenceThreshold = parametrosExtraccion.FaceConfidenceThreshold;
                _biometricClient.FacesDetectAllFeaturePoints = parametrosExtraccion.DetectAllFeaturePoints;
                _biometricClient.FacesDetectBaseFeaturePoints = parametrosExtraccion.DetectAllFeaturePoints;
                _biometricClient.FacesMaximalRoll = parametrosExtraccion.MaximaInclinacionCabezaLados;
                _biometricClient.FacesMaximalYaw = parametrosExtraccion.MaximoAnguloGiroCabeza;
                _biometricClient.FacesMinimalInterOcularDistance = parametrosExtraccion.DistanciaMinimaEntreOjos;
                _biometricClient.FacesQualityThreshold = parametrosExtraccion.FaceQualityThreshold;
                _biometricClient.FacesTemplateSize = parametrosExtraccion.SizeOfTemplate == TemplateSize.Compact ? NTemplateSize.Compact :
                    parametrosExtraccion.SizeOfTemplate == TemplateSize.Small ? NTemplateSize.Small :
                    parametrosExtraccion.SizeOfTemplate == TemplateSize.Medium ? NTemplateSize.Medium : NTemplateSize.Large;
                _biometricClient.FacesLivenessMode = parametrosExtraccion.LivenessCheckMode == FaceExtractionParameters.LivenessMode.None ? NLivenessMode.None :
                    parametrosExtraccion.LivenessCheckMode == FaceExtractionParameters.LivenessMode.Active ? NLivenessMode.Active :
                    parametrosExtraccion.LivenessCheckMode == FaceExtractionParameters.LivenessMode.Passive ? NLivenessMode.Passive :
                    parametrosExtraccion.LivenessCheckMode == FaceExtractionParameters.LivenessMode.PassiveAndActive ? NLivenessMode.PassiveAndActive : NLivenessMode.Simple;

                _biometricClient.FacesDetermineGender = parametrosExtraccion.DeterminarGenero;
                _biometricClient.FacesRecognizeEmotion = parametrosExtraccion.ReconocerEmociones;
                _biometricClient.FacesRecognizeExpression = parametrosExtraccion.ReconocerExpresiones;
                _biometricClient.FacesDetectProperties = parametrosExtraccion.DetectarPropiedades;

                var face = new NFace
                {
                    CaptureOptions = NBiometricCaptureOptions.Manual | NBiometricCaptureOptions.Stream
                };
                _subject = new NSubject();
                if (parametrosExtraccion.LivenessCheckMode != FaceExtractionParameters.LivenessMode.None)
                    _subject.IsMultipleSubjects = false;
                else
                    _subject.IsMultipleSubjects = true;
                _subject.Faces.Add(face);
                facesView.Face = face;

                _biometricClient.UseDeviceManager = true;
                //The Following line is where the error appears
                _biometricClient.BeginCapture(_subject, OnCapturingCompleted, null);
            }
            catch (ArgumentException ex)
            {
                Trace.WriteLine ($"Argument Exception {ex}");
                if (OnCameraCaptureCompleted != null)
                    OnCameraCaptureCompleted(ExtractionStatus.Error, null);
            }
            catch (Exception ex)
            {
                Trace.WriteLine($"Exception {ex}");
            }


The error automatically closes the application. It doesn't get to the catch section. The camera works fine on other windows applications.

Can you please help me to solve this issue. It works fine on most Windows 10 machines, but there are a couple of them that have this issue?

Re: Error Initilaizing Camera

PostPosted: Dec 05, 2017 13:46
by MartynasV
Hello,

First, make sure that you have latest SDK version(revision:171427 version:10 release date:2017/10/25) downloaded.
Then extract SDK from zip package and run "SDK\Bin\Win32_x86\SimpleFacesSampleCS.exe", go to "Enroll from camera" tab and try to capture. Also make sure that no other program is using camera, because other programs can block access to camera.

What cameras you are using?
Please provide SDK revision number(can be found in SDK root directory, in Revision.txt file).

Re: Error Initilaizing Camera

PostPosted: Dec 05, 2017 18:50
by gtoledo
Hi,

I'm using a logitech c920

I was using the version 9 of your SDK. With version 10 seems to work fine so far.

Thanks