another Python wrapper for Intel Realsense camera
- OpenCV (cv2 for Python)
- librealsense2 (pyrealsense2)
- numpy
Tested on:
- D415 / D435
- SR300
To start the pyrs demo, run:
python pyrs.py
p
: save rgb and depth imagec
: change camera presetsi
: save camera intrinsicsq
: quit loop
The recommended way is to use with
statement and run a loop for each frames:
with PyRS() as pyrs:
while True:
# Wait for a coherent pair of frames: depth and color
pyrs.update_frames()
# Get images as numpy arrays
color_image = pyrs.get_color_image() # RGB
depths_image = pyrs.get_depth_frame() # Depth
colorized_depths = pyrs.get_colorized_depth_frame() # Colorized Depth (for rendering)
# do something with the frame
...
But you can also use it normally by creating an instance:
pyrs = PyRS()
while True:
pyrs.update_frames()
...
(Filtered and upsampled with nearest neighbor interpolation)
- Make it possible to use multiple realsense device (device selection)
- Customizable filter