-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proper output of equidistant distortion model. #1225
Conversation
Thank you very much for your code. I encountered the following problem while using the lanch file you gave. I don’t quite understand how to solve it. Can you help me? Checking log directory for disk usage. This may take awhile. started roslaunch server http://localhost:35987/ SUMMARYCLEAR PARAMETERS
PARAMETERS
NODES ROS_MASTER_URI=http://localhost:11311 process[camera/image_undistort_node-1]: started with pid [23504] |
Hi @wang-yu-yang , thanks for trying it! The error is simply because for the first frame received, it does not have yet the distortion parameters as it gets them from ROS. It can be safely ignored. You should get the undistorted image if you run: Hope that helps! |
Thanks for your help, I completed the image correction of a single camera, but for realsense T265, I need to synchronously correct both cameras. The launch file I completed is as follows: Is this correct? |
You can look into doing stereo_undistort: https://github.com/ethz-asl/image_undistort#stereo_undistort_node which will do both together in one node. If you need both unrectified for stereo, then you can also just do stereo directly: https://github.com/ethz-asl/image_undistort#dense_stereo_node |
I'm sorry to bother you again, I used the Stereo_image_undistrot node for testing today, but I ran into trouble, the error is as follows: I will give my launch file and T265 camera calibration file Checking log directory for disk usage. This may take awhile. started roslaunch server http://localhost:41233/ SUMMARYPARAMETERS
NODES ROS_MASTER_URI=http://localhost:11311 process[camera/stereo_undistort-1]: started with pid [32212] |
@wang-yu-yang The problem is that the realsense node doesn't expose the stereo extrinsincs (including the baseline that the stereo rectification node is complaining about). |
@helenol @wang-yu-yang
there show these msg:
then I open the rqt and only check out |
@crankler did you check out this branch/merge these changes? |
ok, i've get the goog result, thank you for your help! |
Hi @helenol After running
Can you help me figure out why |
Hi @doronhi! Thanks for checking the code & how it runs. Unfortunately image_proc does not support equidistant distortion/undistortion (edit: supported in OpenCV in fisheye module: https://docs.opencv.org/3.4/db/d58/group__calib3d__fisheye.html ), even though it's supported in the sensor_msgs format. Here's the undisortion code from image_proc/image_geometry: Which is why we unfortunately have to use a third-party package for the undistortion. |
I restored the redundant spaces to make it easier to follow the change. |
What is this claim based on? I have had had no issues undistorting the T265 images and even stereo rectifying them with the OpenCV Fisheye module: https://docs.opencv.org/3.4/db/d58/group__calib3d__fisheye.html
|
@doronhi Thank you! Glad to have this PR in. @mindThomas Thanks! I wasn't aware. I knew about the fisheye module but didn't realize it was equidistant distortion that was implemented there. Thanks a lot for this, it's very helpful! Nonetheless, image_proc in ROS doesn't support this model. :) |
(Excuse the whitespace changes, my editor automatically strips whitespace at the end of lines).
This changes the output distortion model for the T265 from plumb_bob (which it is not) to equidistant (which it is).
Kannala-Brandt is frequently referred to as equidistant distortion.
Paper: http://www.ee.oulu.fi/~jkannala/publications/tpami2006.pdf
Source for being referred to as equidistant in kalibr: ethz-asl/kalibr#17
Fixing the label of the output to the ROS-supported equidistant model allows simple undistortion of the T265 images using packages like image_undistort (image_proc which is part of ROS only supports radtan/plumb_bob).

Example undistorted image:
Example launch file for undistortion: https://github.com/ethz-asl/image_undistort/blob/master/launch/undistort_t265.launch