Rosanswers logo

Hi, I do some binocular camera calibration tests with image_pipeline. For some reasons, I can not see the video in the image_pipeline/Tutorials page. I have to ask questions there. 1, How can I cange the camera model? You know that diferent cameras should choose the appropriate one. Further, I want to know all the models that image_pipeline supports. 2, How can I get the baseline after I do the calibration? I just get 3 files: left.yaml, right.yaml and ost.txt. I don't see the extrinsic parameters, which I mean a matrix to show transformation relationship between double cameras. Is there some commend to add it into the outputs? Thank you!

Originally posted by YancenBOB on ROS Answers with karma: 9 on 2019-10-11

Post score: 0


1 Answer 1


Rosanswers logo

The PinholeCameraModel from image_geometry supports either the 5 parameter "Plumb Bob" model or the 8 parameter "Rational Polynomial" model. This is specified in REP 104, and implemented using cv::initUndistortRectifyMap in the image_geometry package.

The extrinsic calibration should be included in either the left.yaml or right.yaml file via the R and P parameters in the copmuted camera information. From the sensor_msgs/CameraInfo documentation:

# Projection/camera matrix
#     [fx'  0  cx' Tx]
# P = [ 0  fy' cy' Ty]
#     [ 0   0   1   0]
# ...snip...
# For a stereo pair, the fourth column [Tx Ty 0]' is related to the
#  position of the optical center of the second camera in the first
#  camera's frame. We assume Tz = 0 so both cameras are in the same
#  stereo image plane. The first camera always has Tx = Ty = 0. For
#  the right (second) camera of a horizontal stereo pair, Ty = 0 and
#  Tx = -fx' * B, where B is the baseline between the cameras.

Originally posted by mjcarroll with karma: 6414 on 2019-10-11

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by YancenBOB on 2019-10-11:
Thank you! I have got the baseline. For the camera model, I have another question that dose image_pipeline only support Pinhole camera model and Plumb Bob distortion model? For other calibration tools I see some like equidistant model and so on. I need to use different tools to double check the result.

Comment by mjcarroll on 2019-10-14:
Yes, I believe that those are the only two it supports. At the time that this software was written, these were the only models that OpenCV supported. I believe in recent years, OpenCV has added support for a fisheye model as well, but image_geometry has not been updated to accomodate this.

Comment by YancenBOB on 2019-10-15:
Thanks for your help! Thank you!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.