Created
December 3, 2019 09:18
-
-
Save TakashiYoshinaga/a724148253b738c523336b0dd74d7a6e to your computer and use it in GitHub Desktop.
Initialize Bitmap for Depth Image of Azure Kinect
This file contains 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
//Kinectを扱う変数 | |
Device kinect; | |
//(追加①)Depth画像のBitmap | |
Bitmap depthBitmap; | |
public Form1() | |
{ | |
InitializeComponent(); | |
InitKinect(); | |
//(追加②)Kinectの設定情報に基づいてBitmap関連情報を初期化 | |
InitBitmap(); | |
} | |
//(追加③)Bitmap画像に関する初期設定 | |
private void InitBitmap() | |
{ | |
//Depth画像の横幅(width)と縦幅(height)を取得 | |
int width = kinect.GetCalibration().DepthCameraCalibration.ResolutionWidth; | |
int height = kinect.GetCalibration().DepthCameraCalibration.ResolutionHeight; | |
//PictureBoxに貼り付けるBitmap画像を作成。サイズはkinectのDepth画像と同じ | |
depthBitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment