Coding4Fun Kinect Toolkit

       This project requires the Kinect for Windows SDK.  If you want to learn how to use theKinect for Windows SDK, head over to theChannel 9 and their quick start series. This toolkit contains both a WinForm and WPF version.

Current Coding4Fun Kinect Toolkit:

WPF:

Depth Data Extension Methods:

  • ImageFrame.ToBitmapSource()
    • returns BitmapSource
  • int[].ToBitmapSource()
    • returns BitmapSource
  • int[].ToBitmapSource(int width, int height, int minimumDistance, Color highlightColor)
    • returns BitmapSource
  • ImageFrame.ToDepthArray()
    • returns int[]
  • int[].GetMidpoint(int startX, int startY, int endX, int endY, int minimumDistance)
    • returns Point
  • BitmapSource.Save(string fileName, ImageFormat format)
    • returns nothing

Skeleton Data Extension Methods:

  • Joint.ScaleTo(int width, int height)
    • Scales a Joint's Position to the maximum width and height specified
  • Joint.ScaleTo(int width, int height, float maxSkeletonX, float maxSkeletonY)
    • Scales a Joint's Position to the maximum width and height specified

Controls:

  • Hover Button

WinForm:

Depth Data Extension Methods:

  • ImageFrame.ToBitmap()
    • returns Bitmap
  • int[].ToBitmap()
    • returns Bitmap
  • int[].ToBitmap(int width, int height, int minimumDistance, Color highlightColor)
    • returns Bitmap
  • ImageFrame.ToDepthArray()
    • returns int[]
  • int[].GetMidpoint(int startX, int startY, int endX, int endY, int minimumDistance)
    • returns Point
  • Bitmap.Save(string fileName, ImageFormat format)
    • returns nothing

Skeleton Data Extension Methods:

  • Joint.ScaleTo(int width, int height)
    • Scales a Joint's Position to the maximum width and height specified
  • Joint.ScaleTo(int width, int height, float maxSkeletonX, float maxSkeletonY)
    • Scales a Joint's Position to the maximum width and height specified

Sample usage:

void sensor_ColorFrameReady(AllFramesReadyEventArgs e)
{
	using (ColorImageFrame colorFrame = e.OpenColorImageFrame())
	{
		if (colorFrame == null)
		{
			return; 
		}

		//set image
		ColorImage.Source = colorFrame.ToBitmapSource(); 

		if (_saveColorFrame)
		{
			//save image

			colorFrame.ToBitmapSource().Save(DateTime.Now.ToString("yyyyMMddHHmmss") + "_color.jpg", ImageFormat.Jpeg);
		}
	}            
}

void sensor_DepthFrameReady(AllFramesReadyEventArgs e)
{
	using (DepthImageFrame depthFrame = e.OpenDepthImageFrame())
	{
		if (depthFrame == null)
		{
			return; 
		}

		//turn raw data into an array of distances; 
		var depthArray = depthFrame.ToDepthArray();

		MidPointDistanceViaGetDistanceText.Text = depthFrame.GetDistance(depthFrame.Width/2, depthFrame.Height/2).ToString();

		//image
		DepthImageWithMinDistance.Source = depthArray.ToBitmapSource(depthFrame.Width, depthFrame.Height,
																	_minDistance, Colors.Red);

		//image
		DepthImage.Source = depthFrame.ToBitmapSource();

		if (_saveDepthFrame)
		{
			_saveDepthFrame = false;
			depthFrame.ToBitmapSource().Save(DateTime.Now.ToString("yyyyMMddHHmmss") + "_depth.jpg", ImageFormat.Jpeg);
		}
	}
}

With KinectKit you can:

  • capture and map color, depth, and skeleton data,
  • record and playback audio,
  • integrate movement tracking with speech technology,
  • enumerate and control Microsoft Kinect sensors, and
  • develop applications with your favorite programming language: C++Builder, C++, Delphi, Java, and .NET Framework. 

Within Chant Developer Workbench, you can:

  • Enumerate Microsoft Kinect sensors,
  • Render color, depth, and skeleton data,
  • Trace sensor events, and
  • Test application sensor management functions. 

Movement Management Component Architecture

The KinectKit component library includes a movement management class that provides you a simple way to track and map movement with Microsoft Kinect sensors.

The movement management class, ChantKM, enables you to start and stop color, depth, skeleton, and audio data collection with Microsoft Kinect sensors. Your application can also use the KinectSensor and adjunct classes to manage low-level functions if desired.

With the ChantKM class, you can detect movement, process color, depth, and skeleton data, and record audio to a file. Your application uses the ChantKM class to manage the activities for interacting with the Microsoft Kinect sensor on behalf of your application. The ChantKM class manages the resources and interacts directly with the Natural User Interface API (NAPI) runtime.

Your application receives status notifications through event callbacks.

Speech recognition and synthesis are supported with the SpeechKit ChantSR and ChantTTS classes. See SpeechKit for more information about integrating speech technology.


The ChantKM class encapsulates the NAPI functions to make the process of tracking movement with Microsoft Kinect sensors simple and efficient for your application.

The ChantKM class simplifies the process of managing Microsoft Kinect sensors by handling the low-level activities directly with the sensor.

You instantiate a ChantKM class object before you want to start tracking movement within your application. You destroy the ChantKM class object and release its resources when you no longer want to track movement within your application


http://channel9.msdn.com/coding4fun/kinect/KinectKit-a-commercial-library-to-help-speed-your-Kinect-for-Windows-SDK-application-development
http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=c4fkinect&DownloadId=336481&FileTime=129725745401400000&Build=19612

你可能感兴趣的:(Coding4Fun Kinect Toolkit)