Skip to content

Instantly share code, notes, and snippets.

@TakashiYoshinaga
Last active December 5, 2019 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakashiYoshinaga/16645fcb1ca3fa4b9dc5fe71c9732757 to your computer and use it in GitHub Desktop.
Save TakashiYoshinaga/16645fcb1ca3fa4b9dc5fe71c9732757 to your computer and use it in GitHub Desktop.
Grabbing Images of Kinect
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