10. Kinect for Windowsの概要
サイズ(縦x横x⾼高さ) 65 x 280 x 70(mm)
重量量 600g
Kinect センサー(ケーブル1.5m)
同梱物
USB/電源ケーブル(⻑⾧長さ2.8m)
Windows 7
対応OS
Windows Embedded Standard 7
デュアルコアプロセッサ以上(x86,x64)
2.66GHz以上を推奨
ハードウェア要件
2GB以上のRAM
USB 2.0ポート(専有)
Kinect for Windows SDK
ソフトウェア開発キット(SDK)
http://www.microsoft.com/en-‐‑‒us/kinectforwindows/
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
11. Kinect fot Windows SDK とは
• Kinect for Windows 向けのSDK
• 2012/06/19 現在 v1.5
• 無償で利利⽤用することができる
• 商⽤用利利⽤用に対しての制限はない
• ランタイム(ユーザー環境)の実⾏行行にはKinect
for Windows が必要
• 従来のKinect for Xbox 360 は、 開発時に限定
して使⽤用することが可能(商⽤用利利⽤用はできない)
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
33. Kinect for
Windows SDK ⼊入⾨門
v1.5
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
34. 必要なもの
• Kinect for Windows SDK
• Kinect for Windows Developer Toolkit
• http://www.microsoft.com/en-‐‑‒us/
kinectforwindows/
• Kinect for Windows
• または Kinect fot Xbox 360(開発時のみ)
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
35. 他に使うもの
• Windows 7 SP1 32bit
• Visual C# 2010 Express
• http://www.microsoft.com/japan/
msdn/vstudio/express/
• WPF
• Coding4Fun.Kinect Toolkit
• http://c4fkinect.codeplex.com/
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
36. サンプルコード
• https://github.com/kaorun55/
KinectSdkIntroduction
• サンプルは、順番に機能を追加してい
くようになっています
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
63. MainWindow.xaml.cs
KinectSensor kinect;
public MainWindow()
{
InitializeComponent();
try {
if ( KinectSensor.KinectSensors.Count == 0 ) {
throw new Exception( "Kinectが接続されていません" );
}
// Kinectインスタンスを取得する
kinect = KinectSensor.KinectSensors[0];
// すべてのフレーム更新通知をもらう
kinect.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>( kinect_AllFramesReady );
// Color,Depth,Skeletonを有効にする
kinect.ColorStream.Enable();
kinect.DepthStream.Enable();
kinect.SkeletonStream.Enable();
// Kinectの動作を開始する
kinect.Start();
}
catch ( Exception ex ) {
MessageBox.Show( ex.Message );
Close();
}
}
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
64. MainWindow.xaml.cs
void kinect_AllFramesReady( object sender, AllFramesReadyEventArgs e )
{
imageRgbCamera.Source = e.OpenColorImageFrame().ToBitmapSource();
imageDepthCamera.Source = e.OpenDepthImageFrame().ToBitmapSource();
// 骨格位置の表示
ShowSkeleton( e );
}
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
65. MainWindow.xaml.cs
private void ShowSkeleton( AllFramesReadyEventArgs e )
{
// キャンバスをクリアする
canvas1.Children.Clear();
// スケルトンフレームを取得する
SkeletonFrame skeletonFrame = e.OpenSkeletonFrame();
if ( skeletonFrame != null ) {
// スケルトンデータを取得する
Skeleton[] skeletonData = new Skeleton[skeletonFrame.SkeletonArrayLength];
skeletonFrame.CopySkeletonDataTo( skeletonData );
// プレーヤーごとのスケルトンを描画する
foreach ( var skeleton in skeletonData ) {
if ( skeleton.TrackingState == SkeletonTrackingState.Tracked ) {
// 骨格を描画する
foreach ( Joint joint in skeleton.Joints ) {
// 骨格の座標をカラー座標に変換する
ColorImagePoint point = kinect.MapSkeletonPointToColor( joint.Position, kinect.ColorStream.Format );
// 円を書く
canvas1.Children.Add( new Ellipse()
{
Margin = new Thickness( point.X, point.Y, 0, 0 ),
Fill = new SolidColorBrush( Colors.Black ),
Width = 20,
Height = 20,
} );
}
}
}
}
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
66. こちらもご覧ください
http://www.slideshare.net/kaorun55/kinect-introduction
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
67. KINECT for Windows SDK C#編
http://www.slideshare.net/kaorun55/kinect-for-windows-sdk-c
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.
68. KINECT for Windows SDK C++編
http://www.slideshare.net/kaorun55/kinect-for-windows-sdk-cpp
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons 表示 - 非営利 - 改変禁止 2.1 日本 License.