Search code examples
pythonopencvroscamera-calibrationroi

How to publish/stream roi of rectified images by using image_proc?


I am using ROS to control a drone for real-time image processing applications. I have calibrated camera by using cameracalibrator.py node in Ros. When I use image_proc node to compare raw and rectified images, I don't get what I want. Although image is rectified, border of the image is getting distorted toward opposite direction as the image below:

left image is raw, right image is rectified

As a result, rectified image is still useless for me.

Thus, this time, I calibrated my camera using opencv so that I can get region of interest (ROI) in the image after undistortion operation. Thus, the rectified image becomes perfect for me. However, I need ROS to do that while streaming rectified image by using image_proc. Is there anyway to do that ?


Solution

  • You can directly use the image_proc/crop_decimate nodelet. You can configure it using dynamic_reconfigure to set up ROI or interpolation. However, since these are software operations, interpolation methods should be handled with care (but fastest NN method is standard anyway) since you have a real time application.