Python Wrapper for Intel RealSense SDK 2.0

2.57.7.10387 · active · verified Thu Apr 16

pyrealsense2 is the official Python wrapper for the Intel RealSense SDK 2.0, providing Python bindings to access the full capabilities of Intel RealSense depth and tracking cameras. It is built on top of the C++ librealsense library. The current version is 2.57.7.10387, and the library maintains an active release cadence with updates typically occurring every few months or as new SDK features and bug fixes are introduced.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart initializes a RealSense pipeline, starts streaming, waits for 100 frames, prints the profile of each received frame, and then stops the pipeline. It demonstrates the basic lifecycle of interacting with a RealSense camera.

import pyrealsense2 as rs

pipe = rs.pipeline()
profile = pipe.start()

try:
    # Acquire frames for 100 iterations
    for i in range(0, 100):
        frames = pipe.wait_for_frames()
        for f in frames:
            print(f.profile)
finally:
    pipe.stop()

view raw JSON →