C# 클래스 Accord.Video.Kinect.Kinect

The class provides access to Microsoft's Xbox Kinect controller.

The class allows to manipulate Kinec device by changing its LED color, setting motor's tilt value and accessing its camera. See KinectVideoCamera and KinectDepthCamera classes, which provide access to actual video.

In order to run correctly the class requires freenect.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:

// get Kinect device Kinect kinectDevice = Kinect.GetDevice( 0 ); // change LED color kinectDevice.LedColor = LedColorOption.Yellow; // set motor tilt angle to -10 degrees kinectDevice.SetMotorTilt( -10 ); // get video camera KinectVideoCamera videoCamera = kinectDevice.GetVideoCamera( ); // see example for video camera also
상속: IDisposable
파일 보기 프로젝트 열기: accord-net/framework 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AddFailureHandler void
CheckDevice void
Dispose void
IsDeviceFailed bool
Kinect System
KinectStatusThread void
Kinect_OnError void
StartStatusThread void
StopStatusThread void

공개 메소드들

메소드 설명
Dispose ( ) : void

Dispose device freeing all associated unmanaged resources.

GetAccelerometerValues ( double &x, double &y, double &z ) : void

Get accelerometer values for 3 axes.

Units of all 3 values are m/s2. The g value used for calculations is taken as 9.80665 m/s2.

GetDepthCamera ( ) : KinectDepthCamera

Get Kinect's depth camera.

The method simply creates instance of the KinectDepthCamera class by calling its appropriate constructor. Use KinectDepthCamera.Start method to start the video then.

GetDevice ( int deviceID ) : Kinect

Get initialized instance of the Kinect device.

GetVideoCamera ( ) : KinectVideoCamera

Get Kinect's video camera.

The method simply creates instance of the KinectVideoCamera class by calling its appropriate constructor. Use KinectVideoCamera.Start method to start the video then.

SetLedColor ( LedColorOption ledColor ) : void

Set color of Kinect's LED.

SetMotorTilt ( int angle ) : void

Set motor's tilt value.

비공개 메소드들

메소드 설명
AddFailureHandler ( int deviceID, DeviceFailureHandler handler ) : void
CheckDevice ( ) : void
Dispose ( bool disposing ) : void
IsDeviceFailed ( int deviceID ) : bool
Kinect ( IntPtr rawDevice, int deviceID ) : System
KinectStatusThread ( ) : void
Kinect_OnError ( IntPtr device ) : void
StartStatusThread ( ) : void
StopStatusThread ( ) : void

메소드 상세

Dispose() 공개 메소드

Dispose device freeing all associated unmanaged resources.
public Dispose ( ) : void
리턴 void

GetAccelerometerValues() 공개 메소드

Get accelerometer values for 3 axes.

Units of all 3 values are m/s2. The g value used for calculations is taken as 9.80665 m/s2.

public GetAccelerometerValues ( double &x, double &y, double &z ) : void
x double X axis value on the accelerometer.
y double Y axis value on the accelerometer.
z double Z axis value on the accelerometer.
리턴 void

GetDepthCamera() 공개 메소드

Get Kinect's depth camera.

The method simply creates instance of the KinectDepthCamera class by calling its appropriate constructor. Use KinectDepthCamera.Start method to start the video then.

public GetDepthCamera ( ) : KinectDepthCamera
리턴 KinectDepthCamera

GetDevice() 공개 정적인 메소드

Get initialized instance of the Kinect device.
There is no Kinect device with specified ID connected to the system. Failed connecting to the Kinect device specified ID.
public static GetDevice ( int deviceID ) : Kinect
deviceID int ID of the Kinect device to get instance of, [0, ),
리턴 Kinect

GetVideoCamera() 공개 메소드

Get Kinect's video camera.

The method simply creates instance of the KinectVideoCamera class by calling its appropriate constructor. Use KinectVideoCamera.Start method to start the video then.

public GetVideoCamera ( ) : KinectVideoCamera
리턴 KinectVideoCamera

SetLedColor() 공개 메소드

Set color of Kinect's LED.
Some error occurred with the device. Check error message.
public SetLedColor ( LedColorOption ledColor ) : void
ledColor LedColorOption LED color to set.
리턴 void

SetMotorTilt() 공개 메소드

Set motor's tilt value.
Motor tilt has to be in the [-31, 31] range. Some error occurred with the device. Check error message.
public SetMotorTilt ( int angle ) : void
angle int Tilt value to set, [-31, 30] degrees.
리턴 void