'Ros2 : stereo image rectification

I'm starting to develop a visual odometry program. The "front" part (image acquisition and hopefully rectification) is done in ROS2, then the core of the processing will be done with openCV.

I'm getting the stereo images for now from a ros bag (until I get the real camera), along with the corresponding calibration information. I have the following topics :

/stereo/left/image_raw
/stereo/left/camera_info
/stereo/right/image_raw
/stereo/right/camera_info

I managed to retrieve the images and camera_info in my own rosnode (and I should be able to transform them to opencv images, even if I haven't implemented that part yet).

However, I have 2 missing steps in my image pipeline : undistorting and stereo-rectification.

In ROS1, I could have used the "stereo_image_proc" node from the "stereo_image_proc" package to do those 2 steps :

ROS_NAMESPACE=stereo rosrun stereo_image_proc stereo_image_proc

In ROS2 however, it turns out that the package stereo_image_proc still exists, however the stereo_image_proc node in it no longer exists.

Do you know about any ROS2 package that enables transforming the pair of raw camara image topics (+ camera_info topics) into undistorted and rectified images? (results in color or BW, I don't care much)

Or if it is easier, is there a (simple) way to do this undistortion/rectification in opencv (using the data from the camera_info topics)?

Thanks a lot in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source