Convert MATLAB stereoParams to ROS cam info parameters (stereo camera calibration)

asked 2020-08-06 13:54:10 -0500

thebonaroo gravatar image

I am trying to go from MATLAB camera calibration stereoParams object ( to the ROS calibration parameters as outlined in sensor_msgs/CameraInfo message (

The reason I am doing this conversion is that the Matlab calibration I have is super accurate <0.5 pixel epipolar error and I have had problems with the ROS calibrator.

I've had no luck with this conversion and have tried OpenCV's stereoRectify() function however it gives incosistent results and doesn't rectify the images accurately (epipolar error of about 10 pixels after rectification).

Is there any MATLAB support for doing this conversion? Has anyone done this before?

I primarily need to figure out how to get the exxtrinsic parameters required by ROS (R,P) as the intrinsic parameters (K,D) don't change between MATLAB and ROS.

Matlab computes the rotation, translation, essential, and fundamental matrices as the extrinsic parameters for a stereo rig. ROS requires a rectification and projection matrix for both the left and right cameras of the rigs.

edit retag flag offensive close merge delete