C# 클래스 AForge.Robotics.Surveyor.SRV1Camera

Provides access to video stream from Surveyor SRV-1 Blackfin camera.

The class allows to continuously receive video frames from Surveyor SRV-1 Blackfin camera. It creates a background thread and periodically requests new video frames from SRV-1 robot/camera, which are provided to user through NewFrame event. The video frame rate can be configured using FrameInterval property, which sets time interval between frames.

In order to get instance of this class, use SRV1.GetCamera or SVS.GetCamera methods.

Sample usage:

// get SRV-1 camera SRV1Camera camera = srv.GetCamera( ); // in the case you work with Surveyor SVS board // the next line can be use // SRV1Camera camera = svs.GetCamera( SVS.Camera.Left ); // set NewFrame event handler camera.NewFrame += new NewFrameEventHandler( video_NewFrame ); // start the video source camera.Start( ); // ... private void video_NewFrame( object sender, NewFrameEventArgs eventArgs ) { // get new frame Bitmap bitmap = eventArgs.Frame; // process the frame }
상속: IVideoSource
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
FlipVideo ( bool isFlipped ) : void

Flip video capture or not (for use with upside-down camera).

SetQuality ( int quality ) : void

Set video quality.

The method sets video quality, which is specified in [1, 8] range - 1 is the highest quality level, 8 is the lowest quality level.

Setting higher quality level and resolution may increase delays for other requests processed by SRV1 class. So if robot is used not only for video, but also for controlling servos/motors, and higher response level is required, then do not set very high quality and resolution.

SetResolution ( SRV1 resolution ) : void

Set video resolution.

Setting higher quality level and resolution may increase delays for other requests processed by SRV1 class. So if robot is used not only for video, but also for controlling servos/motors, and higher response level is required, then do not set very high quality and resolution.

SignalToStop ( ) : void

Signal video source to stop its work.

Signals video source to stop its background thread, stop to provide new frames and free resources.

Start ( ) : void

Start video source.

Starts video source and return execution to caller. Video source object creates background thread and notifies about new frames with the help of NewFrame event.

Stop ( ) : void

Stop video source.

Stops video source aborting its thread.

Since the method aborts background thread, its usage is highly not preferred and should be done only if there are no other options. The correct way of stopping camera is signaling it to stop and then waiting for background thread's completion.

WaitForStop ( ) : void

Wait for video source has stopped.

Waits for video source stopping after it was signalled to stop using SignalToStop method.

비공개 메소드들

메소드 설명
Free ( ) : void

Free resource.

SRV1Camera ( SRV1 communicator ) : System
WorkerThread ( ) : void

Worker thread.

메소드 상세

FlipVideo() 공개 메소드

Flip video capture or not (for use with upside-down camera).
public FlipVideo ( bool isFlipped ) : void
isFlipped bool Specifies if video should be flipped (), /// or not ().
리턴 void

SetQuality() 공개 메소드

Set video quality.

The method sets video quality, which is specified in [1, 8] range - 1 is the highest quality level, 8 is the lowest quality level.

Setting higher quality level and resolution may increase delays for other requests processed by SRV1 class. So if robot is used not only for video, but also for controlling servos/motors, and higher response level is required, then do not set very high quality and resolution.

Invalid quality level was specified.
public SetQuality ( int quality ) : void
quality int Video quality to set, [1, 8].
리턴 void

SetResolution() 공개 메소드

Set video resolution.

Setting higher quality level and resolution may increase delays for other requests processed by SRV1 class. So if robot is used not only for video, but also for controlling servos/motors, and higher response level is required, then do not set very high quality and resolution.

public SetResolution ( SRV1 resolution ) : void
resolution SRV1 Video resolution to set.
리턴 void

SignalToStop() 공개 메소드

Signal video source to stop its work.
Signals video source to stop its background thread, stop to provide new frames and free resources.
public SignalToStop ( ) : void
리턴 void

Start() 공개 메소드

Start video source.
Starts video source and return execution to caller. Video source object creates background thread and notifies about new frames with the help of NewFrame event.
Not connected to SRV-1. Connection to SRV-1 /// was closed using method. New /// instance must be obtained using or /// methods. ///
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stop video source.

Stops video source aborting its thread.

Since the method aborts background thread, its usage is highly not preferred and should be done only if there are no other options. The correct way of stopping camera is signaling it to stop and then waiting for background thread's completion.

public Stop ( ) : void
리턴 void

WaitForStop() 공개 메소드

Wait for video source has stopped.
Waits for video source stopping after it was signalled to stop using SignalToStop method.
public WaitForStop ( ) : void
리턴 void