Kinect2 Pointcloud Record

I’m trying to figure out how to record the Kinect2 pointcloud for later playback. I assumed and read elsewhere that I should be able to just record both Kinect TOPS with moviefileouts and then just play them back through, but not having luck. Am I missing something here?kinectPointCloud.3.toe (7.9 KB)

1 Like

Textures that are used for the point cloud are 32bit floating point - which often means that they end up compressed when saved out to file using the moviefile out TOP. You might consider using the pack top (before recording, and an unpack when playing back), or recording these as an exr sequence to make sure you have the bit depth you need.

I tried out the Pack TOPs set appropriately and wasn’t able to get it working. However, I found a much easier solution for my use case. The Kinect Studio application that comes with the SDK actually records and plays back nicely, with TD treating playback just like live sensor data. The playback just overrides the live sensor input.

Did you use the .mkv file from the Kinect DK Recorder? I can’t figure out how to get it into the Kinect Azure TOP.

The Kinect Azure TOP doesn’t currently support loading the multi-track mkv files from the kinect recorder, but there are tools out there to split up the file so that it can be loaded in.

This thread has some discussions about it: Mock live feed into Kinect Azure TOP - #5 by JetXS

1 Like

Amazing, just what I need. Thank you Rob!

Hi guys, I’m also looking for a solution inside TD. I tried to pack, save, and unpack, but no way with H264 or MOV. Even if i get back an image (often darker than original) the unpack is always all black :frowning: I think the compression brokes something inside values…
I also tried the EXR solution (very very very slow), but I cannot understand how to read the saved files…
Do I have to read them 1 by 1 or there is an automatic way?
Thank you!

If you direct the Point File or Movie File In TOP to just the folder where the EXR files are, then it should automatically load them in sequence.

EXR files can definitely be a little slow because there’s a lot of data and there and its lossless to avoid artifacts. I’ve had it running at 60fps pretty reliably at Kinect point clouds resolutions (around 640x480), but I start to drop frames on my system if I try to do full 4 channel 32 bit at HD res.

I think Microsoft gets around this with the kinect recorder by just recording the 16bit depth map in a lossless format, and then reprojecting that into 3D points when loading.

Yes, I agree… I’m building a component to pack 16blit floating data in 2 8bit fixed images to save them in ANIMATION codec. Just like the pack TOP but with half resolution, just because also ANIMATION is very slow on my PCs. :frowning:

I’ve found a solution to the slow EXR issue! We have to increase the maximum threads parameter that is at 1 by default!!!

1 Like

Glad its working better. The EXR library theoretically uses multiply threads to save each file, but the parameter allows TouchDesigner to save multiple files at once which could help depending on the bottleneck.

If you’re interested, there is an experimental build posted here: Generating Pointclouds from Depth Map / Color Image - #35 by adrianmeyerart that allows you to save just the depth map and rebuild the exact point cloud later using new python functions from the Kinect Azure TOP. The depth map can just be 6 bit and saves a lot more efficiently than the full point cloud, but there is a bit more processing to reproject it afterwards.