Unable to set ROI while recording in python
Hello,
I'm trying to set ROI while recording. I checked it's working in realsense-viewer so I expect to be able to do it in python. However, something is failing and I don't know how to solve it. The following piece of python code returns False when recording is enabled (so sensor is not ROI adjustable) and return True when recording is disabled
import pyrealsense2 as rs
config = rs.config()
config.enable_stream(
rs.stream.depth,
640,
480,
rs.format.z16,
15,
)
config.enable_stream(
rs.stream.color,
640,
480,
rs.format.rgb8,
15,
)
#config.enable_record_to_file("/tmp/capture.bag")
pipeline = rs.pipeline()
profile = pipeline.start(config)
pipeline.wait_for_frames()
is_roi = profile.get_device().first_depth_sensor().is_roi_sensor()
print(f"Is ROI sensor: {is_roi}")
pipeline.stop()
am I doing something wrong? Any clues on what may be happening?
-
Hi Irodriguez A RealSense team member provides a Python code snippet in the link below for setting the autoexposure ROI after the pipeline has been started.
https://github.com/IntelRealSense/librealsense/issues/2681
Please sign in to leave a comment.
Comments
1 comment