Kinect SDK player detection

Every player has an index in the Skeleton array: void nui_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) { SkeletonFrame sf = e.SkeletonFrame; //check which skeletons in array are active and use that array indexes for player index SkeletonData player1 = sf.Skeletons[playerIndex1]; SkeletonData player2 = sf.Skeletons[playerIndex2]; You can use that index to identify your players if one leave and … Read more

Kinect raw depth to distance in meters

The correct answer is actually a comment on your question. The number given is actually a distance in millimetres. To get this number, you either need to use a skeleton joint and call DepthImageFrame’s MapFromSkeletonPoint or shift the raw short value right by DepthImageFrame.PlayerIndexBitmaskWidth. E.g. Skeleton using (var skeletonFrame= e.OpenSkeletonFrame()) using (var depthFrame = e.OpenDepthImageFrame()) … Read more

Convert Kinect ColorImageFrame to Bitmap

You can find the answer in this article. To summarize it, this method should do the trick: Bitmap ImageToBitmap(ColorImageFrame img) { byte[] pixeldata = new byte[img.PixelDataLength]; img.CopyPixelDataTo(pixeldata); Bitmap bmap = new Bitmap(img.Width, img.Height, PixelFormat.Format32bppRgb); BitmapData bmapdata = bmap.LockBits( new Rectangle(0, 0, img.Width, img.Height), ImageLockMode.WriteOnly, bmap.PixelFormat); IntPtr ptr = bmapdata.Scan0; Marshal.Copy(pixeldata, 0, ptr, img.PixelDataLength); bmap.UnlockBits(bmapdata); return … Read more

OpenCV: How to visualize a depth image

According to the documentation, the function imshow can be used with a variety of image types. It support 16-bit unsigned images, so you can display your image using cv::Mat map = cv::imread(“image”, CV_LOAD_IMAGE_ANYCOLOR | CV_LOAD_IMAGE_ANYDEPTH); cv::imshow(“window”, map); In this case, the image value range is mapped from the range [0, 255*256] to the range [0, … Read more

Kinect user Detection

Also see Jurgeon D’s answer on Kinect SDK player detection, as it deals with skeleton index. @Fixus is also right in that you could use a ID. But if you mean more than 2 people are detected, then only one is detected, that is not programming, that is in the Kinect’s hardware and @FelixK. was … Read more