How do I get a single frame from a recorded depth video from kinect?

3 views (last 30 days)
I'm trying to create a 3-D point cloud using data from a Kinect.
Most of the code I've seen so far uses getsnapshot or set or something of the like to capture a real-time frame and create the point cloud based on that. I would like to be able to create a point cloud from a recorded videoinput object, rather than a snapshot, because I'm essentially trying to create a video of a recorded 3-D environment. I've gotten as far as extracting the frame data (using depthFrames = getdata(depthVid)) but I can't figure out what to do from there.
I thought I would create a plot cloud based on one frame and use a loop to repeat it, but I don't know how to access a single frame from the frame data I extracted above. If anyone could tell me how to do that, or suggest a better way to create a point cloud video, I would appreciate it!
  1 Comment
Zheng
Zheng on 31 Jul 2015
you need to call the function pcfromkinect in Computer Vision System Toolbox (CVST) to retrieve the point cloud. Starting from 15a, CVST provides many point cloud specific functionalities.
Another workaround is to rescale X, Y coordinates using a known focal length from the kinect spec, and take the Z values as the depth value you get from the depth image. You can find related information on Microsoft SDK, but this is in generally not recommended for its poor accuracy.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!