Last active
December 5, 2019 02:45
-
-
Save TakashiYoshinaga/16645fcb1ca3fa4b9dc5fe71c9732757 to your computer and use it in GitHub Desktop.
Grabbing Images of Kinect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task KinectLoop() | |
{ | |
//loopがtrueの間はデータを取り続ける | |
while (loop) | |
{ | |
//kinectから新しいデータをもらう | |
using (Capture capture = await Task.Run(() => kinect.GetCapture()).ConfigureAwait(true)) | |
{ | |
//カラー/Depth画像にKinectで取得した情報を書き込む | |
SetColorBitmap(capture); | |
SetDepthBitmap(capture); | |
//カラー/Depth画像をPictureBoxに貼り付ける | |
pictureBox1.Image = colorBitmap; | |
pictureBox2.Image = depthBitmap; | |
} | |
//表示を更新 | |
this.Update(); | |
} | |
//ループが終了したらKinectも停止 | |
kinect.StopCameras(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment