C# Класс 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 }
Наследование: IVideoSource
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
Free ( ) : void
WorkerThread ( ) : void

Описание методов

GetParamFloat() публичный метод

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.
Результат float

GetParamInt() публичный метод

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.
Результат int

GetParamString() публичный метод

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.
Результат string

SetParam() публичный метод

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.
Результат void

SetParam() публичный метод

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.
Результат void

SignalToStop() публичный метод

Signal video source to stop its work.

public SignalToStop ( ) : void
Результат void

Start() публичный метод

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
Результат void

Stop() публичный метод

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
Результат void

WaitForStop() публичный метод

Wait for video source has stopped.

public WaitForStop ( ) : void
Результат void

XimeaVideoSource() публичный метод

Initializes a new instance of the XimeaVideoSource class.
public XimeaVideoSource ( int deviceID ) : System
deviceID int XIMEA camera ID (index) to connect to.
Результат System