Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kinect v2, read out data from .xef files

Tags:

kinect

I have collected a bunch of videos using Kinect for windows 2 using the kinect studio with file extension .xef.

Now I want to write a program to load data from them and just playback or save as another format, but I have found little resource to doing so, is there any useful resource to do that?

like image 832
Coderzelf Avatar asked Dec 03 '14 20:12

Coderzelf


3 Answers

Actually, you can use the Kinect Studio API to read and play .xef files since the last SDK release (KinectSDK-v2.0_1409). It is just not properly documented yet, but can be integrated into your code. Here is a short description to use it (tried in a VS 2013 C# Solution):

  1. Go to the installation Folder of the KinectStudio (e.g. C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Tools\KinectStudio­).
  2. Reference "Microsoft.Kinect.Tools.dll" in your project.
  3. Copy "KStudioService.dll" to your Debug or Release folder.
  4. Change BuildProperties to x64 (otherwise you get a BadImageFormatException).

The API is described here.

And here is some sample code from Carmine from the Microsoft Kinect team.

like image 184
0epsilon Avatar answered Oct 18 '22 05:10

0epsilon


what you can do is reading the xef file using the Kinect Studio, then going to Play (or Playback) tab and hit play, your program will start streaming. I think it's the only way to do that, doing like it's coming from the kinect.

like image 20
Shb-Lrb Avatar answered Oct 18 '22 05:10

Shb-Lrb


There seems not having a way to parse XEF file to extract the images directly yet.

If you do not need all frames stored in XEF file, i.e., frame dropping is ok, an indirect way is to make a Kinect application to receive frames from XEF file via Kinect service.

A quick test is:

  1. Launch KinectStudio, connect to Kinect service, open XEF file.
  2. Launch ColorBasics-D2D or DepthBasics-D2D (from Kinect v2 SDK).
  3. Play the XEF file in KinectStudio.
  4. The color/depth frames are displayed in the ColorBasics or DepthBasics app.

You can then modify the source code in ColorBasics or DepthBasics to save the images accordingly. You can modify KinectFusionExplorer-D2D if you care about aligning depth and color images.

This approach can only capture a subset of frames stored in the XEF because the playback and frame receiving via Kinect service is asynchronous. Therefore it will only work if frame dropping is not an issue in your program.

like image 1
songuke Avatar answered Oct 18 '22 05:10

songuke