RGBD

Visualizes an example recording from the NYUD dataset with RGB and Depth channels.

RGBD example screenshot

Used Rerun types

Image, Pinhole, DepthImage

Background

The dataset, known as the NYU Depth V2 dataset, consists of synchronized pairs of RGB and depth frames recorded by the Microsoft Kinect in various indoor scenes. This example visualizes one scene of this dataset, and offers a rich source of data for object recognition, scene understanding, depth estimation, and more.

Logging and visualizing with Rerun

The visualizations in this example were created with the following Rerun code:

Timelines

All data logged using Rerun in the following sections is connected to a specific time. Rerun assigns a timestamp to each piece of logged data, and these timestamps are associated with a timeline.

rr.set_time_seconds("time", time.timestamp())

Image

The example image is logged as Image to the world/camera/image/rgb entity.

rr.log("world/camera/image/rgb", rr.Image(img_rgb).compress(jpeg_quality=95))

Depth image

Pinhole camera is utilized for achieving a 3D view and camera perspective through the use of the Pinhole.

rr.log( "world/camera/image", rr.Pinhole( resolution=[img_depth.shape[1], img_depth.shape[0]], focal_length=0.7 * img_depth.shape[1], ), )

Then, the depth image is logged as an DepthImage to the world/camera/image/depth entity.

rr.log("world/camera/image/depth", rr.DepthImage(img_depth, meter=DEPTH_IMAGE_SCALING))

Run the code

To run this example, make sure you have the Rerun repository checked out and the latest SDK installed:

# Setup pip install --upgrade rerun-sdk # install the latest Rerun SDK git clone git@github.com:rerun-io/rerun.git # Clone the repository cd rerun git checkout latest # Check out the commit matching the latest SDK release

Install the necessary libraries specified in the requirements file:

pip install -r examples/python/rgbd/requirements.txt

To experiment with the provided example, simply execute the main Python script:

python examples/python/rgbd/main.py # run the example

You can specify the recording:

python examples/python/rgbd/main.py --recording {cafe,basements,studies,office_kitchens,playroooms}

If you wish to customize it, explore additional features, or save it use the CLI with the --help option for guidance:

python examples/python/rgbd/main.py --help