Sensors & Effectors/Camera

[Active IR Stereo Camera][Intel Realsense] pyrealsense2 API

jstar0525 2021. 7. 12. 18:37
반응형
import pyrealsense2 as rs

pipeline = rs.pipeline()
pipe_profile = pipeline.start()
frames = pipeline.wait_for_frames()
depth_frame = frames.get_depth_frame()
color_frame = frames.get_color_frame()
depth_intrin = depth_frame.profile.as_video_stream_profile().intrinsics
color_intrin = color_frame.profile.as_video_stream_profile().intrinsics
depth_to_color_extrin = depth_frame.profile.get_extrinsics_to(color_frame.profile)
depth_sensor = pipe_profile.get_device().first_depth_sensor()
depth_scale = depth_sensor.get_depth_scale()
depth_pixel = [200, 200]
depth_point = rs.rs2_deproject_pixel_to_point(depth_intrin, depth_pixel, depth_scale)
color_point = rs.rs2_transform_point_to_point(depth_to_color_extrin, depth_point)
color_pixel = rs.rs2_project_point_to_pixel(color_intrin, color_point)
pipeline.stop()

 

https://github.com/IntelRealSense/librealsense/pull/1118

 

Python API additions by zivsha · Pull Request #1118 · IntelRealSense/librealsense

API Changes Renamed align.proccess to process, fixed example code to match. API Additions: Adding missing functions to stream_profile: is_default register_extrinsics_to (Following PR #1106) and f...

github.com

 

반응형