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
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
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