C# Класс AForge.Video.Kinect.KinectVideoCamera

Video source for Microsoft Kinect's video camera.

The video source captures video data from Microsoft Kinect video camera, which is aimed originally as a gaming device for XBox 360 platform.

Prior to using the class, make sure you've installed Kinect's drivers as described on Open Kinect project's page.

In order to run correctly the class requires libfreenect.dll library to be put into solution's output folder. This can be found within the AForge.NET framework's distribution in Externals folder.

Sample usage:

// create video source KinectVideoCamera videoSource = new KinectVideoCamera( 0 ); // set NewFrame event handler videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame ); // start the video source videoSource.Start( ); // ... private void video_NewFrame( object sender, NewFrameEventArgs eventArgs ) { // get new frame Bitmap bitmap = eventArgs.Frame; // process the frame }
Наследование: IVideoSource
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
KinectVideoCamera ( int deviceID ) : System

Initializes a new instance of the KinectVideoCamera class.

KinectVideoCamera ( int deviceID, CameraResolution resolution ) : System

Initializes a new instance of the KinectVideoCamera class.

KinectVideoCamera ( int deviceID, CameraResolution resolution, VideoCameraMode cameraMode ) : System

Initializes a new instance of the KinectVideoCamera class.

SignalToStop ( ) : void

Signal video source to stop its work.

Calling this method is equivalent to calling Stop for Kinect video camera.

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.

Calling this method is equivalent to calling Stop for Kinect video camera.

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

Метод Описание
HandleDataReceived ( IntPtr device, IntPtr imageData, UInt32 timeStamp ) : void

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

KinectVideoCamera() публичный Метод

Initializes a new instance of the KinectVideoCamera class.
public KinectVideoCamera ( int deviceID ) : System
deviceID int Kinect's device ID (index) to connect to.
Результат System

KinectVideoCamera() публичный Метод

Initializes a new instance of the KinectVideoCamera class.
public KinectVideoCamera ( int deviceID, CameraResolution resolution ) : System
deviceID int Kinect's device ID (index) to connect to.
resolution CameraResolution Resolution of video camera to set.
Результат System

KinectVideoCamera() публичный Метод

Initializes a new instance of the KinectVideoCamera class.
public KinectVideoCamera ( int deviceID, CameraResolution resolution, VideoCameraMode cameraMode ) : System
deviceID int Kinect's device ID (index) to connect to.
resolution CameraResolution Resolution of video camera to set.
cameraMode VideoCameraMode Sets video camera mode.
Результат System

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

Signal video source to stop its work.

Calling this method is equivalent to calling Stop for Kinect video camera.

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.
The specified resolution is not supported for the selected /// mode of the Kinect video camera. Could not connect to Kinect's video camera. Another connection to the specified video camera is already running.
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.

Calling this method is equivalent to calling Stop for Kinect video camera.

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