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:
- Launch KinectStudio, connect to Kinect service, open XEF file.
- Launch ColorBasics-D2D or DepthBasics-D2D (from Kinect v2 SDK).
- Play the XEF file in KinectStudio.
- 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.
GetDefaultKinectSensor
, callOpen
, get theIBodyFrameSource
andIBodyFrameReader
, all good, but when I callIBodyFrameReader::AcquireLatestFrame
, it gives me "E_PENDING The data necessary to complete this operation is not yet available.". Same with the sample code included in the SDK, btw. – Korten