Abstract Kinect for Windows RGB Kinect for Windows v Kinect for Windows v2

Similar documents
グラフィックス 目次

VGB Kinect v2 VGB VGB Kinect v2 3 VGB VGB Discrete Continuous 2 Discrete : Jump, Sit, NicoNii AdaBoost (Confidence) Visual Studio 2013 or 2012 () Kine

XAML Do-It-Yourself 第 3 回ベントとトリガー XML Do-It-Yourself 第 3 回目は ベント処理とトリガーについて学習します Windows フォームゕプリケーションでは たとえば ボタンが押された というベントに対応する処理 ( ベントハンドラー ) を記述する

WPF アプリケーションの 多言語切替

Chart3D for WPF/Silverlight

画像処理技術を利用した Kinectの応用

スライド 1

PowerPoint プレゼンテーション

C#の基本2 ~プログラムの制御構造~

untitled

KINECT for Windows入門

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略   

Visual Studio Do-It-Yourself 第 9 回ユーザーコントロール 第 6 回のリソースから第 8 回のテンプレートで さまざまな方法でコントロールをカスタマズできるこ とを学びました 今回のテーマであるユーザーコントロールは 既存の一つのコントロールをカスタマ ズするのではな

WPF アプリケーションの 多言語切替

DEMO1 まずはやってみよう アクティビティをダブルクリック 作成 - プロジェクト C# => Workflow CodeActivity をぽとぺ シーケンシャルと ステートマシン それぞれのコ ンソールアプリ あとライブラリがある びっくりマークは足りていないあかし プロパティをみると判別で

Visual Studio2008 C# で JAN13 バーコードイメージを作成 xbase 言語をご利用の現場でバーコードの出力が必要なことが多々あります xbase 言語製品によっては 標準でバーコード描画機能が付加されているものもあるようで す C# では バーコードフォントを利用したりバー

VB 資料 電脳梁山泊烏賊塾 音声認識 System.Speech の利用 System.Speech に依るディクテーション ( 音声を文字列化 ).NetFramework3.0 以上 (Visual Studio 2010 以降 ) では 標準で System.Speech が用意されて居るの

C#の基本

グラフィックス

新しいイテレーション型開発

PowerPoint プレゼンテーション

ICONファイルフォーマット

BarCode for WPF

目次 1. 研究の背景と目的 Kinect の概要 Kinect の仕組み Kinect の原理 Kinect for Windows と Xbox 360 Kinect Kinect の実用例...3

TOEIC

…E…B…U†[…h‡ðŠp‡¢‡½‚ΟbfiI…v…“…O…›…•‡Ì’¶’¬‡Ì™ñ‹Ä

sp2-2.indd

OutlookBar for WPF/Silverlight

// // GENES Version 1.00 突然変異と自然

BarCode for UWP

Windows Phone アプリケーション開発 写真加工アプリケーションの作成 日本マイクロソフト株式会社 デベロッパー & プラットフォーム統括本部監修

Java学習教材

XAML Do-It-Yourself シリーズ 第 7 回テンプレート -1-

XAML Do-It-Yourself シリーズ 第 1 回 XAML 概要 -1-

A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3,

<4D F736F F D B B83578B6594BB2D834A836F815B82D082C88C60202E646F63>

ピコ秒パルスレーザ基板ライブラリ (tmhidld.dll) 説明書 珠電子株式会社 2013/04/30 概要 ピコ秒パルスレーザ基板を制御するための.Net Framework 4.0 ライブラリについて説明します ユーザアプリケーション (VB.net VC.net VC#.net LabVI

HOW DO I WebBrowser コントロールで HTML5 を 使用するには ここでは以下の手順で説明します Video 要素を使用する Silverlight と JavaScript の間でやり取りする Canvas 要素を使用する Video 要素を使用する 1. Visual Stu

第1回日本産婦人科

任意の加算プログラム

Table 1 Table 2

C# ++ MASA C# ( ) XNA 1.1 C# ( ) VisualStuio XNA 4.0 VisualStuio XNA 3.1 * * *3 2.1 VisualStuio Windows ( TextGam

OpenCV IS Report No Report Medical Information System Labratry

10-C.._241_266_.Z

r3.dvi

< F2D82518E9F8AD CC834F CC8CFC82AB82C68D4C>

Windows Phone アプリケーション開発 DailyCalendar の作成 日本マイクロソフト株式会社 デベロッパー & プラットフォーム統括本部作成

SharpShooter Reports.WPF 基本的な使い方 Last modified on: November 15, 2012 本ドキュメント内のスクリーンショットは英語表記ですが SharpShooter Reports JP( 日本語版 ) では日本語で表示されます

< F2D A839382CC906A2E6A7464>

平成 29 年度卒業研究 初心者のためのゲームプログラミング用 教材の開発 函館工業高等専門学校生産システム工学科情報コース 5 年 25 番細見政央指導教員東海林智也

ウィンドウ操作 応用

An Interactive Visualization System of Human Network for Multi-User Hiroki Akehata 11N F

...Visual Studio 2015\Projects\MyHomePage 用サンプル \Database(Access2)\Database(Access2)\MainForm.cs 2 れを含めておかないと Database への更新がきかない oadp.fill(dtbl); dgvk

スライド 1

FinancialChart for WPF


XAML Do-It-Yourself シリーズ 第 8 回ゕニメーション -1-

ch31.dvi

Microsoft PowerPoint - Windows Presentation Foundation (WPF) 3.5 の新機能

WPF アプリケーションの 多言語切替

< F2D89BA8EE882C E6A7464>

マイクロソフト株式会社 デベロッパー & プラットフォーム統括本部 井上大輔 井上章

: : : TSTank 2

( ) p.1 x y y = ( x ) 1 γ γ = filtergamma.java import java.applet.*; public class filtergamma extends Applet{ Image img; Image new_img; publi

Prog2_12th

グラフィックス 目次

10K pdf

WinHPC ppt

2 回路図

Java演習(4) -- 変数と型 --

CudaWaveField

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

GUIプログラムⅣ

Java演習(9) -- クラスとメソッド --

< F2D834F838C A815B A CC>

< F2D B838A835882CC8CF68EAE2E6A7464>

プロセス間通信

cpp4.dvi


Arduino UNO IS Report No. Report Medical Information System Laboratory

PDFViewer for WPF/Silverlight

2008 DS T050049

ファイル操作

text_08.dvi

Windows Phone アプリケーション開発 設定タイルアプリケーションの作成 日本マイクロソフト株式会社 デベロッパー & プラットフォーム統括本部監修

kiri_17.pdf

つるい27-5月号PDF.indd

& Vol.5 No (Oct. 2015) TV 1,2,a) , Augmented TV TV AR Augmented Reality 3DCG TV Estimation of TV Screen Position and Ro

MVP for VB が語る C# 入門

Windows (L): D:\jyugyou\ D:\jyugyou\ D:\jyugyou\ (N): en2 OK 2

D:\Documents\Visual Studio 2015\Projects\MyHomePage 用サンプル \ExcelAndWord\ExcelAndWord\MainForm.cs 1 /* */ Excel や Word とやりとりする ~9,20 仕様 Excel

Sparkline for WPF

Carousel for WPF/Silverlight

ActionScript Flash Player 8 ActionScript3.0 ActionScript Flash Video ActionScript.swf swf FlashPlayer AVM(Actionscript Virtual Machine) Windows

基礎輪講2週目 Kinectの話

< F2D E E6A7464>

< F2D F B834E2E6A7464>

PowerPoint プレゼンテーション

5 p Point int Java p Point Point p; p = new Point(); Point instance, p Point int 2 Point Point p = new Point(); p.x = 1; p.y = 2;

ORiN CAO USB (3) CAO CAO USB ORiN CAO USB 1 2 (4) CAO 3 CAO USB 4 PC OS 1 CPU:Pentium IV 2. 8GHz :512MByte Windows XP SP2 Professional ORiN2 SDK USB D

Transcription:

Kinect 2014 9 19 IS Report No. 2014092901 Report Medical Information System Laboratory

Abstract Kinect for Windows 2012 2 RGB Kinect for Windows v2 2014 7 Kinect for Windows v2

1............................ 2 2............................ 3 2.1............................ 3 2.2............................ 3 3............................ 5 3.1.......................... 5 3.2............................ 5 3.3 Body............................ 6 3.4........................... 7 A........................... 8 A.1.......................... 8 A.2....................... 11

1 Kinect Microsoft Xbox 360 RGB 3 Kinect Xbox 360 2012 2 Windows PC Kinect for Windows( Kinect v1) Kinect v1 Kinect 1) 2014 7 RGB kinect for Windows v2( Kinect v2) kinect v2 2

2 2.1 Kinect v2 Table. 2.1 Table. 2.1 OS Windows 8 CPU Visual Studio 2012 USB3.0 Dual-Core 2.66GHz GPU DirectX 11.0 RAM 2.0GBytes Kinect v1 Windows 7 Kinect v2 Windows 8 Visual Studio 2012 Kinect v1 USB2.0 Kinect v2 USB3.0 2.2 Kinect v2 Microsoft Kinect for Windows SDK SDK 1. SDK(Kinect for Windows SDK 2.0 Public Preview) Fig. 2.1 http://www.microsoft.com/en-us/download/details.aspx?id=43661 Fig. 2.1 SDK ( ) 2. SDK Fig. 2.2 3

2.2 2 Fig. 2.2 ( ) 3. Kinect v2 PC PC Gesture Builder Kinect Studio v2.0 SDK Browser v2.0 (Kinect for Windows) 4. SDK Browser v2.0 (Kinect for Windows) Fig. 2.3 RUN SDK Browser v2.0 (Kinect for Windows) Color Depth Body Fig. 2.3 SDK Browser v2.0 (Kinect for Windows) ( ) 4

3 3.1 Kinect v2 Visual Studio 2013 Visual C# WPF Microsoft.Kinect Fig. 3.1 Kinect v2 using Microsoft.Kinect https://github.com/kaorun55/kinect-for-windows-sdk-v2.0-samples (a) WPF Fig. 3.1 ( ) (b) 3.2 28 CameraMode.color color Depth Infrared CameraMode.Color RGB Bitmap Fig. 3.2(a) CameraMode.Depth Bitmap Kinect v2 TOF(Time Of Flight) Fig. 3.2(b) CameraMode.Infrared Bitmap Fig. 3.2(c) 5

3.3Body 3 (a) (b) (c) Fig. 3.2 ( ) 3.3 Body Body Kinect 6 joint( ) joint Fig. 3.3(a) 25 joint joint joint 3 2 2 (1 Color 2 Depth/Infrared) CoordinateMapper 1920 1080 4/10 768 432 image joint 2 pointx pointy 4/10 Fig. 3.3(b) Body 1 ColorSpacePoint colorpoint = sensor.coordinatemapper.mapcamerapointtocolorspace( jointposition); 2 DepthSpacePoint depthpoint = sensor.coordinatemapper.mapcamerapointtodepthspace( jointposition); (a) joint Fig. 3.3 joint ( ) (b) Body 6

3.4 3 3.4 TextBox joint Elbow Left Hand Left 2 MainWindow.xaml 1 MainWindow.xaml.cs body 2 p1 Elbow Left 2 p2 Hand Left 2 TextBox Fig. 3.4 1 CameraSpacePoint jointposition = joint.position; 2 3 if (i == 0) 4 { // 3D space point 5 jointposition = body.joints[jointtype.elbowleft].position; 6 } 7 if (i == 1) 8 { // 3D space point 9 jointposition = body.joints[jointtype.handleft].position; 10 } 11 12 // 2D space point 13 System.Windows.Point point = new System.Windows.Point(); 14 15 if ( mode == CameraMode.Color) 16 { 17 ColorSpacePoint colorpoint = sensor.coordinatemapper.mapcamerapointtocolorspace( jointposition); 18 19 point.x = float.isinfinity(colorpoint.x)? 0 : colorpoint.x; 20 point.y = float.isinfinity(colorpoint.y)? 0 : colorpoint.y; 21 22 if (i == 0) 23 { 24 p1 = point; 25 } 26 if (i == 1) 27 { 28 p2 = point; 29 } 30 } Fig. 3.4 ( ) 7

A A.1 MainWindow.xaml 1 <Window x:class=" v2.mainwindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 Title="MainWindow" Height="550" Width="730" 5 Loaded="Window_Loaded" Closed="Window_Closed"> 6 7 <Grid> 8 <Image Name="camera" Width="768" Height="432" /> 9 <Canvas Name="canvas" Width="768" Height="432" /> 10 <Button x:name="_screenshotbutton" Content="ScreenShot" Margin="0,480,620,0" Click="_ScreenshotButton_Click" /> 11 <Label x:name="label1" Content="" HorizontalAlignment="Left" Margin=" 107,487,0,0" VerticalAlignment="Top" Width="147"/> 12 </Grid> 13 </Window> MainWindow.xaml.cs 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using System.Windows; 7 using System.Windows.Controls; 8 using System.Windows.Data; 9 using System.Windows.Documents; 10 using System.Windows.Input; 11 using System.Windows.Media; 12 using System.Windows.Media.Imaging; 13 using System.Windows.Navigation; 14 using System.Windows.Shapes; 15 using Microsoft.Kinect; 16 17 namespace v2 18 { 19 /// <summary> 20 /// MainWindow.xaml 21 /// </summary> 22 public partial class MainWindow : Window 23 { 24 KinectSensor sensor; 25 MultiSourceFrameReader reader; 26 IList<Body> bodies; 27 28 CameraMode mode = CameraMode.Color; 29 30 public MainWindow() 31 { 32 InitializeComponent(); 33 } 34 35 private void Window Loaded(object sender, RoutedEventArgs e) 36 { 8

A.1 A 37 sensor = KinectSensor.GetDefault(); 38 39 if ( sensor!= null) 40 { 41 sensor.open(); 42 43 reader = sensor.openmultisourceframereader(framesourcetypes.color FrameSourceTypes.Depth FrameSourceTypes.Infrared FrameSourceTypes. Body); 44 reader.multisourceframearrived += Reader MultiSourceFrameArrived; 45 } 46 } 47 48 private void Window Closed(object sender, EventArgs e) 49 { 50 if ( reader!= null) 51 { 52 reader.dispose(); 53 } 54 55 if ( bodies!= null) 56 { 57 if ( bodies.count() > 0) 58 { 59 foreach (var body in bodies) 60 { 61 // body.dispose(); 62 } 63 } 64 } 65 66 if ( sensor!= null) 67 { 68 sensor.close(); 69 } 70 } 71 72 void Reader MultiSourceFrameArrived(object sender, MultiSourceFrameArrivedEventArgs e) 73 { 74 var reference = e.framereference.acquireframe(); 75 76 // Color 77 using (var frame = reference.colorframereference.acquireframe()) 78 { 79 if (frame!= null) 80 { 81 if ( mode == CameraMode.Color) 82 { 83 camera.source = frame.tobitmap(); 84 } 85 } 86 } 87 88 // Depth 89 using (var frame = reference.depthframereference.acquireframe()) 90 { 91 if (frame!= null) 92 { 93 if ( mode == CameraMode.Depth) 94 { 95 camera.source = frame.tobitmap(); 96 } 97 } 98 } 99 100 // Infrared 9

A.1 A 101 using (var frame = reference.infraredframereference.acquireframe()) 102 { 103 if (frame!= null) 104 { 105 if ( mode == CameraMode.Infrared) 106 { 107 camera.source = frame.tobitmap(); 108 } 109 } 110 } 111 112 // Body 113 using (var frame = reference.bodyframereference.acquireframe()) 114 { 115 if (frame!= null) 116 { 117 canvas.children.clear(); 118 119 bodies = new Body[frame.BodyFrameSource.BodyCount]; 120 121 frame.getandrefreshbodydata( bodies); 122 123 foreach (var body in bodies) 124 { 125 if (body.istracked) 126 { 127 // COORDINATE MAPPING 128 foreach (Joint joint in body.joints.values) 129 { 130 if (joint.trackingstate == TrackingState.Tracked) 131 { 132 // 3D space point 133 CameraSpacePoint jointposition = joint.position; 134 135 // 2D space point 136 System.Windows.Point point = new System.Windows.Point(); 137 138 if ( mode == CameraMode.Color) 139 { 140 ColorSpacePoint colorpoint = sensor.coordinatemapper. MapCameraPointToColorSpace(jointPosition); 141 142 point.x = float.isinfinity(colorpoint.x)? 0 : colorpoint.x; 143 point.y = float.isinfinity(colorpoint.y)? 0 : colorpoint.y; 144 } 145 else if ( mode == CameraMode.Depth mode == CameraMode.Infrared) // Change the Image and Canvas dimensions to 512x424 146 { 147 DepthSpacePoint depthpoint = sensor.coordinatemapper. MapCameraPointToDepthSpace(jointPosition); 148 149 point.x = float.isinfinity(depthpoint.x)? 0 : depthpoint. X; 150 point.y = float.isinfinity(depthpoint.y)? 0 : depthpoint. Y; 151 } 152 153 // Draw 154 Ellipse ellipse = new Ellipse 155 { 156 Fill = System.Windows.Media.Brushes.Red, 157 Width = 15, 158 Height = 15 159 }; 160 161 Canvas.SetLeft(ellipse, point.x 4 / 10 ellipse.width / 2); 10

A.2 A 162 Canvas.SetTop(ellipse, point.y 4 / 10 ellipse.height / 2); 163 164 canvas.children.add(ellipse); 165 } 166 } 167 } 168 169 } 170 } 171 } 172 } 173 174 /// <summary> 175 /// 176 /// </summary> 177 int count = 0; 178 private void ScreenshotButton Click(object sender, RoutedEventArgs e) 179 { 180 count++; 181 string name = "capture" + count + ".bmp"; 182 Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, 183 Screen.PrimaryScreen.Bounds.Height); 184 //Graphics 185 Graphics g = Graphics.FromImage(bmp); 186 // 187 g.copyfromscreen(new System.Drawing.Point(0, 0), new System.Drawing.Point(0, 0), bmp.size); 188 // 189 bmp.save(name); 190 g.dispose(); 191 label1.content = "save " + name; 192 } 193 } 194 195 enum CameraMode 196 { 197 Color, 198 Depth, 199 Infrared 200 } 201 } A.2 1 1 <Window x:class=" v2.mainwindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 Title="MainWindow" Height="550" Width="730" 5 Loaded="Window_Loaded" Closed="Window_Closed"> 6 7 <Grid> 8 <Image Name="camera" Width="768" Height="432" /> 9 <Canvas Name="canvas" Width="768" Height="432" /> 10 <Button x:name="_screenshotbutton" Content="ScreenShot" Margin="0,480,620,0" Click="_ScreenshotButton_Click" /> 11 <Label x:name="label1" Content="" HorizontalAlignment="Left" Margin=" 107,487,0,0" VerticalAlignment="Top" Width="147"/> 12 <TextBox x:name="text1" Content="" HorizontalAlignment="Left" Height="40" TextWrapping="Wrap" Margin="10,4,0,0" VerticalAlignment="Top" Width="117" FontSize="28" /> 13 </Grid> 14 </Window> 2 11

A.2 A 1 // COORDINATE MAPPING 2 foreach (Joint joint in body.joints.values) 3 { 4 if (joint.trackingstate == TrackingState.Tracked) 5 { 6 for (int i = 0; i < 2; i++) 7 { 8 CameraSpacePoint jointposition = joint.position; 9 10 if (i == 0) 11 { 12 // 3D space point 13 jointposition = body.joints[jointtype.elbowleft].position; 14 } 15 if (i == 1) 16 { 17 // 3D space point 18 jointposition = body.joints[jointtype.handleft].position; 19 } 20 21 // 2D space point 22 System.Windows.Point point = new System.Windows.Point(); 23 24 if ( mode == CameraMode.Color) 25 { 26 ColorSpacePoint colorpoint = sensor.coordinatemapper.mapcamerapointtocolorspace( jointposition); 27 28 point.x = float.isinfinity(colorpoint.x)? 0 : colorpoint.x; 29 point.y = float.isinfinity(colorpoint.y)? 0 : colorpoint.y; 30 31 if (i == 0) 32 { 33 p1 = point; 34 } 35 if (i == 1) 36 { 37 p2 = point; 38 } 39 } 40 else if ( mode == CameraMode.Depth mode == CameraMode.Infrared) // Change the Image and Canvas dimensions to 512x424 41 { 42 DepthSpacePoint depthpoint = sensor.coordinatemapper. MapCameraPointToDepthSpace(jointPosition); 43 44 point.x = float.isinfinity(depthpoint.x)? 0 : depthpoint.x; 45 point.y = float.isinfinity(depthpoint.y)? 0 : depthpoint.y; 46 } 47 48 // Draw 49 Ellipse ellipse = new Ellipse 50 { 51 Fill = System.Windows.Media.Brushes.Red, 52 Width = 15, 53 Height = 15 54 }; 55 56 Canvas.SetLeft(ellipse, point.x 4 / 10 ellipse.width / 2); 57 Canvas.SetTop(ellipse, point.y 4 / 10 ellipse.height / 2); 58 59 canvas.children.add(ellipse); 60 } 61 62 double v1 = Math.Sqrt(0 + 10 10); 12

A.2 A 63 double v2 = Math.Sqrt((p2.X p1.x) (p2.x p1.x) + (p2.y p1.y) (p2.y p1.y )); 64 double v3 = (10 (p2.x p1.x) + 0 (p2.y p1.y)); 65 66 double degree = (Math.Acos(v3 / v1 / v2)) 180 / Math.PI; 67 double deg = (180 degree); 68 69 if (p1.y >p2.y) 70 { 71 Text1.Text = ("+ " + deg.tostring("f1")); 72 } 73 74 else if (p1.y <p2.y) 75 { 76 Text1.Text = ("- " + deg.tostring("f1")); 77 } 78 else if (p1.y == p2.y) 79 { 80 Text1.Text = (" 0"); 81 } 82 } 83 } 13

1),,. Kinect for windows sdk c#., No. 1, 2012. 14