0
$\begingroup$

Rosanswers logo

Hi guys,

I am trying to obtain the stereo un-rectified calibration (that is un-rectified extrinsics R and t; and calibration matrix K for each camera) from the left_camera_info.yaml and the right_camera_info.yaml configuration files. The only unrectified information that I can get straightforward from the configuration files is the instrinsic matrix K and distortion parameters D. But I do not know how to get the un-rectified extrinsic R and T.

I think I should use R rotation rectification matrix and Projection matrix from right configuration file right_camera_info.yaml but I am not sure how should I use them.

Any suggestions? thank you very much

This is my left_camera_info.yaml

image_width: 672
image_height: 376
camera_name: narrow_stereo/left
camera_matrix:
  rows: 3
  cols: 3
  data: [348.522264, 0.000000, 344.483596, 0.000000, 348.449870, 188.808062, 0.000000, 0.000000, 1.000000]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.174497, 0.027127, -0.000359, 0.000457, 0.000000]
rectification_matrix:
  rows: 3
  cols: 3
  data: [0.999873, 0.000708, 0.015892, -0.000683, 0.999999, -0.001578, -0.015893, 0.001567, 0.999872]
projection_matrix:
  rows: 3
  cols: 4
  data: [347.652079, 0.000000, 339.375946, 0.000000, 0.000000, 347.652079, 198.590004, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]

This is my right_camera_info.yaml

image_width: 672
image_height: 376
camera_name: narrow_stereo/right
camera_matrix:
  rows: 3
  cols: 3
  data: [349.569635, 0.000000, 340.836585, 0.000000, 349.390781, 206.105440, 0.000000, 0.000000, 1.000000]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.174606, 0.027855, -0.000108, -0.000141, 0.000000]
rectification_matrix:
  rows: 3
  cols: 3
  data: [0.999997, -0.000440, 0.002268, 0.000436, 0.999999, 0.001573, -0.002269, -0.001572, 0.999996]
projection_matrix:
  rows: 3
  cols: 4
  data: [347.652079, 0.000000, 339.375946, -41.272771, 0.000000, 347.652079, 198.590004, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]

Originally posted by taihu on ROS Answers with karma: 56 on 2018-03-01

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I was doing a little bit research about this, and I could answer the question by myself. I just check the stereoRectify function implementation in OpenCV (this function is used to perform the rectification process in ROS).

I do the following to obtain them (python code):

// get un-rectified rotation matrix

R_unrectified = R_left_rectified.dot(inv(R_right_rectified))

// get un-rectified translation vector

fx = P_right_rectified[0][0]

t_rectified = np.array(P_right_rectified[:,3]) / fx

t_unrectified = inv(R_right_rectified).dot(t_rectified)


Originally posted by taihu with karma: 56 on 2019-03-06

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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