Setting Auto-Exposure Region-of-Interest with ROS2
I read through the Tuning Depth Cameras for Best Performance document (https://dev.intelrealsense.com/docs/tuning-depth-cameras-for-best-performance) and am interested in setting a different region-of-interest for auto-exposure on my D405 cameras. I'm using ROS2, but I can't find any documentation for how I can set the region via ROS2. Is this feature available via ROS2?
-
Hi Toni Divic In ROS1 the depth auto-exposure ROI can be set in the launch file like this:
<rosparam> /camera/stereo_module/auto_exposure_roi/left: 20 /camera/stereo_module/auto_exposure_roi/right: 200 </rosparam>
I am not aware of a past case of the auto-exposure ROI being defined in the RealSense ROS2 wrapper. It is probable though that the ROI parameters could be set in ROS2 using the ros2 param set command. Applying the general structure of a ros2 param set instruction to the information above, a ROS2 ROI command might look like the ones below.
ros2 param set
/camera/camera auto_exposure_roi/left 20
ros2 param set/camera/camera auto_exposure_roi/right 200
-
There is not a definition for the left and right ROI parameters in ROS, and there are not top and bottom parameters. I would speculate without knowing for certain though that left and right refer to a start horizontal coordinate and an end vertical coordinate, allowing a ROI box to be drawn between those two coordinates.
-
Hmm, not sure if I fully understand still. Are you suggesting each coordinate can be defined by a single value (e.g. if each row has 10 pixels, row 0 has coordinates 0-9, then row 1 continues with 10-19, etc)?
Is there somewhere I can find more in-depth information? Or is there a way for me to set the ROI parameters then visualize what region is drawn so I can figure out the coordinate system?
-
The number of horizontal and vertical pixels in an image is determined by the resolution. So in an 848x480 image there will be 848 pixels in the horizontal direction and 480 pixels in the vertical direction. So 20 would be 20 pixels in horizontally from the left top corner of the image and 200 would be 200 pixels down vertically from the top of the image.
The center-point of an image is half of the resolution. So on an 848x480 image, the center coordinate would be 424x240.
-
The librealsense SDK uses a different coordinate system for setting the ROI, by defining a minimum and maximum X and Y.
-
Yeah, I understand how the coordinate system typically would work, it just doesn't make sense to me how we can define a box with only 2 values. I would expect a minimum of 4, like in the librealsense SDK.
Is there a way you can confirm the values in ROS2 with the development team somehow, or should I just assume that ROI isn't yet supported in ROS2?
Please sign in to leave a comment.
Comments
12 comments