open3d.t.io.RSBagReader#

class open3d.t.io.RSBagReader#
RealSense Bag file reader.

Only the first color and depth streams from the bag file will be read.

  • The streams must have the same frame rate.

  • The color stream must have RGB 8 bit (RGB8/BGR8) pixel format

  • The depth stream must have 16 bit unsigned int (Z16) pixel format

The output is synchronized color and depth frame pairs with the depth frame aligned to the color frame. Unsynchronized frames will be dropped. With alignment, the depth and color frames have the same viewpoint and resolution. See format documentation here

Warning

A few frames may be dropped if user code takes a long time (>10 frame intervals) to process a frame.

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self)

  2. __init__(self, buffer_size=32)

Parameters:

buffer_size (int, optional, default=32) – Size of internal frame buffer, increase this if you experience frame drops.

close(self: open3d.cpu.pybind.t.io.RSBagReader) None#

Close the opened RS bag playback.

static create(filename)#

Create RGBD video reader based on filename

Parameters:

filename (str) – Path to the RGBD video file.

Returns:

open3d.t.io.RGBDVideoReader

get_timestamp(self: open3d.cpu.pybind.t.io.RSBagReader) int#

Get current timestamp (in us).

is_eof(self: open3d.cpu.pybind.t.io.RSBagReader) bool#

Check if the RS bag file is all read.

is_opened(self: open3d.cpu.pybind.t.io.RSBagReader) bool#

Check if the RS bag file is opened.

next_frame(self: open3d.cpu.pybind.t.io.RSBagReader) open3d.cpu.pybind.t.geometry.RGBDImage#

Get next frame from the RS bag playback and returns the RGBD object.

open(self, filename)#

Open an RS bag playback.

Parameters:

filename (str) – Path to the RGBD video file.

Returns:

bool

save_frames(self, frame_path, start_time_us=0, end_time_us=18446744073709551615)#

Save synchronized and aligned individual frames to subfolders.

Parameters:
  • frame_path (str) – Frames will be stored in stream subfolders ‘color’ and ‘depth’ here. The intrinsic camera calibration for the color stream will be saved in ‘intrinsic.json’

  • start_time_us (int, optional, default=0) – Start saving frames from this time (us)

  • end_time_us (int, optional, default=18446744073709551615) – (default video length) Save frames till this time (us)

Returns:

None

seek_timestamp(self, timestamp)#

Seek to the timestamp (in us).

Parameters:

timestamp (int) – Timestamp in the video (usec).

Returns:

bool

property metadata#

Get metadata of the RS bag playback.