C# Class AForge.Video.Ximea.XimeaVideoSource

The class provides continues access to XIMEA cameras.

The video source class is aimed to provide continues access to XIMEA camera, when images are continuosly acquired from camera and provided throw the NewFrame event. It just creates a background thread and gets new images from XIMEA camera keeping the specified time interval between image acquisition. Essentially it is a wrapper class around XimeaCamera providing IVideoSource interface.

Sample usage:

// create video source for the XIMEA camera with ID 0 XimeaVideoSource videoSource = new XimeaVideoSource( 0 ); // set event handlers videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame ); // start the video source videoSource.Start( ); // set exposure time to 10 milliseconds videoSource.SetParam( CameraParameter.Exposure, 10 * 1000 ); // ... // New frame event handler, which is invoked on each new available video frame private void video_NewFrame( object sender, NewFrameEventArgs eventArgs ) { // get new frame Bitmap bitmap = eventArgs.Frame; // process the frame }
Inheritance: IVideoSource
Afficher le fichier Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Méthodes publiques

Méthode Description
GetParamFloat ( string parameterName ) : float

Get camera's parameter as float value.

The call is redirected to XimeaCamera.GetParamFloat.

GetParamInt ( string parameterName ) : int

Get camera's parameter as integer value.

The call is redirected to XimeaCamera.GetParamFloat.

GetParamString ( string parameterName ) : string

Get camera's parameter as string value.

The call is redirected to XimeaCamera.GetParamString.

SetParam ( string parameterName, float value ) : void

Set camera's parameter.

The call is redirected to XimeaCamera.GetParamFloat.

SetParam ( string parameterName, int value ) : void

Set camera's parameter.

The call is redirected to XimeaCamera.SetParam(string, int).

SignalToStop ( ) : void

Signal video source to stop its work.

Start ( ) : void

Start video source.

Starts video source and returns execution to caller. Video camera will be started and will provide new video frames through the NewFrame event.

Stop ( ) : void

Stop video source.

The method stops the video source, so it no longer provides new video frames and does not consume any resources.

WaitForStop ( ) : void

Wait for video source has stopped.

XimeaVideoSource ( int deviceID ) : System

Initializes a new instance of the XimeaVideoSource class.

Private Methods

Méthode Description
Free ( ) : void
WorkerThread ( ) : void

Method Details

GetParamFloat() public méthode

Get camera's parameter as float value.

The call is redirected to XimeaCamera.GetParamFloat.

public GetParamFloat ( string parameterName ) : float
parameterName string Parameter name to get from camera.
Résultat float

GetParamInt() public méthode

Get camera's parameter as integer value.

The call is redirected to XimeaCamera.GetParamFloat.

public GetParamInt ( string parameterName ) : int
parameterName string Parameter name to get from camera.
Résultat int

GetParamString() public méthode

Get camera's parameter as string value.

The call is redirected to XimeaCamera.GetParamString.

public GetParamString ( string parameterName ) : string
parameterName string Parameter name to get from camera.
Résultat string

SetParam() public méthode

Set camera's parameter.

The call is redirected to XimeaCamera.GetParamFloat.

public SetParam ( string parameterName, float value ) : void
parameterName string Parameter name.
value float Float parameter value.
Résultat void

SetParam() public méthode

Set camera's parameter.

The call is redirected to XimeaCamera.SetParam(string, int).

public SetParam ( string parameterName, int value ) : void
parameterName string Parameter name.
value int Integer parameter value.
Résultat void

SignalToStop() public méthode

Signal video source to stop its work.

public SignalToStop ( ) : void
Résultat void

Start() public méthode

Start video source.
Starts video source and returns execution to caller. Video camera will be started and will provide new video frames through the NewFrame event.
There is no XIMEA camera with specified ID connected to the system. An error occurred while communicating with a camera. See error /// message for additional information.
public Start ( ) : void
Résultat void

Stop() public méthode

Stop video source.

The method stops the video source, so it no longer provides new video frames and does not consume any resources.

public Stop ( ) : void
Résultat void

WaitForStop() public méthode

Wait for video source has stopped.

public WaitForStop ( ) : void
Résultat void

XimeaVideoSource() public méthode

Initializes a new instance of the XimeaVideoSource class.
public XimeaVideoSource ( int deviceID ) : System
deviceID int XIMEA camera ID (index) to connect to.
Résultat System