Simple python 3 utility to grab and save frames (asynchronously) from RGB-D sensors used for research.
Currently support two rgbd sensors: - Kinect2 - Realsense
# instantiate Kinect2 or Realsense sensor = Kinect2() # instantiate the recorder recorder = VideoRecorder(save_path, fps, width, height) # Inside the with statement, launch/release the async processes with sensor, recorder: # Get the list of frames grabbed (empty list if there is no new frames) frames = sensor.get_frames() # Or pop the last frame (will block until next frame) frame = sensor.pop_frame() # Send image to recorder recorder.save_frame(frame.rgb)
Frame contains an rgb numpy array [H, W, C], depth (mm) numpy array [H, W] and timestamp (s)
- Recorder process could be based on a listener principle to have different recorder on the same process
- Kinect2: implement function to get intrinsics from the driver
Write an issue or send a pull request!