MCA Camera Preview TImeouts

MCA Camera Preview TImeouts

A customer of mine in Colombia has integrated their application with the MCA to embed camera functionality. THey have developed using the MCA SDK. Everything works great, except that the preview times out at random intervals. It is set ot 15 seconds in the MCA Config, but in practice, it is sometimes 15, sometimes 2, or 8. The timeout period experienced does not follow a pattern - that is, iot does not get progressively shorter, for example. It seems wholly random, but not more than 15 seconds.
Is the code below that is used to implement the function flawed?

using System;

using System.Collections.Generic;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Intel.Healthcare;

using Intel.Healthcare.Device;

using Intel.Healthcare.Exception;

using BaseISA;

namespace InspeccionDeLinea

{

///

/// Esta clase proporciona la interfaz con la camara

///

public class Camara : IDisposable

{

private Camera _laCamara;

//private CameraOptions opcionesCamara;

private bool captura = true;

//Panel que muestra las frames adquiridas por la camara

Panel _picVisualizadorCamara;

//PictureBox destino del frame(fotografia capturada)

PictureBox _panelVisualizadorFoto;

public Camara()

{

_laCamara = new Camera();

}

public void SetCamara(Panel visualizadorCamara, PictureBox visualizadorFoto)

{

_picVisualizadorCamara = visualizadorCamara;

_panelVisualizadorFoto = visualizadorFoto;

}

public void IniciarVistaPrevia()

{

try

{

//reserva el dispositivo

_laCamara.ReserveDevice();// _laCamara.ReserveDevice(11000);

//Prende la camara e inicia la visualizacion en el PictureBox.

_laCamara.StartPreview(_picVisualizadorCamara.Handle);

}

catch (Exception ex)

{

GlobalISA.pdlgMensajeISA.Show("No hay acceso al dispositivo. " + ex.ToString());

_laCamara.ReleaseDevice();

}

}

public void PararVistaPrevia()

{

try

{

if (!captura)

{

//Para de mostrar la vista previa

_laCamara.StopPreview();

}

//Libera el recurso

_laCamara.ReleaseDevice();

}

catch (Exception ex)

{

GlobalISA.pdlgMensajeISA.Show(ex.Message);

_laCamara.ReleaseDevice();

}

_laCamara.ReleaseDevice();

}

public void Capturar()

{

try

{

//Captura una foto con la camara.

_laCamara.CaptureFrame();

//Toma la imagen de la coleccin de imagenes de la camara

Frame frame = _laCamara.Frames[_laCamara.Frames.Count - 1];

//la muestra en el picturebox

_panelVisualizadorFoto.Image = frame.Image;

_laCamara.ReleaseDevice();

}

catch (Exception ex)

{

GlobalISA.pdlgMensajeISA.Show("No hay acceso al dispositivo. " + ex.ToString());

_laCamara.ReleaseDevice();

}

}

public void Close()

{

_laCamara.Dispose();

}

public void Dispose()

{

this.Dispose();

_laCamara.Dispose();

GC.SuppressFinalize(this);

}

}

}

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi akappler11,

A couple of bits of additional info would help us out:

1. Can you tell me what version of SDK is being used by the developer?

2. Can you tell me MCA hardware is being used?

3. What version of the MCA platform driver is installed on the MCA hardware?

4. Except for the random time out, does the preview work correctly and can you take the photo\image?

5. Do you ever see any error messages during the process?

6. Can you provide a copy of the MCA configuration file (IntelHealthcare.cfg)?

Thanks,

Steve

Thank you for the information. I'll ask our developers to take a look at this and see if they can determine what is happening.

-Steve

Hi akappler11,

Here is what we suspect is happening:

1. The IdleTimeoutSeconds value in the camera plug-in section that the developer is setting different values for will not play a role in the preview timeout. It does not like there are any competing applications for the camera device.

2. We did not see any message boxes popping up in the demo video. This means the camera device is not released due to some exception. We did notice an some exception message boxes are shown in the provided code.

3. The probable cause can be that the used InspeccionDeLinea.Camera object is getting out of scope and garbage collected. This is only guess as we dont have the code for those areas. The randomness of the preview closure probably caused by the nondeterministic GC invocation which destroys the InspeccionDeLinea.Camera object. In such case the Intel.Healthcare.Device.Camera destructor will be called and the camera device will be released, after closing the active preview. They can probably place a message box or a break point (while debugging) in the InspeccionDeLinea.camera.Dispose() function to verify this. If this is the cause of the problem, the developers can create the InspeccionDeLinea.Camera object with higher scope.

If this is not enough info to help point the developer in the right direction, then we would likely need their application source code to troubleshoot in more detail.

Thanks,

Steve

I'll send this over to the team in Colombia and follow up here ASAP.
So I am clear:
1) IdleTimeoutSeconds is not affecting the symptom. But it is competing unsuccessfully with the MCA.
2) No pop-ups means no exception.
3) Debug on InspeccionDeLinea.Camera.Dispose() may find the issue. Creating the object with higher scope may solve.

4) You would be willing to review the app source code if we need more help.

Thanks!!!

Leave a Comment

Please sign in to add a comment. Not a member? Join today