0
$\begingroup$

Rosanswers logo

I did a stereo calibration of two rgb-cameras with the camera_calibration package.

$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 right:=/my_stereo/right/image_raw left:=/my_stereo/left/image_raw right_camera:=/my_stereo/right left_camera:=/my_stereo/left

I am actually interested in the Rotation and Translation between the two camera frames. But I do not understand how to get this information from the output I got:

[image]

width
640

height
480

[narrow_stereo/left]

camera matrix
648.128948 0.000000 310.456734
0.000000 645.852354 239.382301
0.000000 0.000000 1.000000

distortion
-0.004746 0.045946 -0.002314 -0.002279 0.000000

rectification
0.999426 0.029044 0.017429
-0.028984 0.467011 0.883776
0.017528 -0.883774 0.467585

projection
3533.740115 0.000000 378.726444 0.000000
0.000000 3533.740115 -2855.120445 0.000000
0.000000 0.000000 1.000000 0.000000

# oST version 5.0 parameters


[image]

width
640

height
480

[narrow_stereo/right]

camera matrix
541.784078 0.000000 311.829932
0.000000 540.030207 240.621846
0.000000 0.000000 1.000000

distortion
0.047129 -0.150119 -0.000644 -0.002149 0.000000

rectification
0.997956 0.054935 0.032662
-0.054994 0.477731 0.876783
0.032563 -0.876787 0.479775

projection
3533.740115 0.000000 378.726444 0.000000
0.000000 3533.740115 -2855.120445 305.406125
0.000000 0.000000 1.000000 0.000000


Left:
('D = ', [-0.004745505276970892, 0.04594649780065838, -0.0023144618343065573, -0.0022789476229827144, 0.0])
('K = ', [648.1289483347696, 0.0, 310.4567342485528, 0.0, 645.8523544134756, 239.38230099187072, 0.0, 0.0, 1.0])
('R = ', [0.9994261827735477, 0.029043505832408213, 0.01742928442759996, -0.02898385832798141, 0.4670110286018882, 0.8837763490389581, 0.017528295499529056, -0.8837743908561558, 0.4675848424871277])
('P = ', [3533.74011530084, 0.0, 378.72644424438477, 0.0, 0.0, 3533.74011530084, -2855.120445251465, 0.0, 0.0, 0.0, 1.0, 0.0])

Right:
('D = ', [0.04712904679290734, -0.15011876036543534, -0.0006437146133086122, -0.0021494622132509017, 0.0])
('K = ', [541.7840777852443, 0.0, 311.82993239170753, 0.0, 540.030207287234, 240.621846446304, 0.0, 0.0, 1.0])
('R = ', [0.9979555802017678, 0.05493504956821761, 0.032661908595344215, -0.05499401026517345, 0.4777307594543458, 0.8767833143406234, 0.03256253643540602, -0.8767870105105982, 0.47977517591136526])
('P = ', [3533.74011530084, 0.0, 378.72644424438477, 0.0, 0.0, 3533.74011530084, -2855.120445251465, 305.4061245407626, 0.0, 0.0, 1.0, 0.0])
('self.T', [-0.00475289834567013, 0.041288237125056894, 0.07577665175074097])
('self.R', [0.9995476404618809, -0.02547661638974252, -0.015983005487590064, 0.0256884644291203, 0.9995829459246669, 0.013192308813783209, 0.01564024431907163, -0.01359692001499986, 0.999785230198839])


[image]

width
640

height
480

[narrow_stereo/left]

camera matrix
648.128948 0.000000 310.456734
0.000000 645.852354 239.382301
0.000000 0.000000 1.000000

distortion
-0.004746 0.045946 -0.002314 -0.002279 0.000000

rectification
0.999426 0.029044 0.017429
-0.028984 0.467011 0.883776
0.017528 -0.883774 0.467585

projection
3533.740115 0.000000 378.726444 0.000000
0.000000 3533.740115 -2855.120445 0.000000
0.000000 0.000000 1.000000 0.000000

# oST version 5.0 parameters


[image]

width
640

height
480

[narrow_stereo/right]

camera matrix
541.784078 0.000000 311.829932
0.000000 540.030207 240.621846
0.000000 0.000000 1.000000

distortion
0.047129 -0.150119 -0.000644 -0.002149 0.000000

rectification
0.997956 0.054935 0.032662
-0.054994 0.477731 0.876783
0.032563 -0.876787 0.479775

projection
3533.740115 0.000000 378.726444 0.000000
0.000000 3533.740115 -2855.120445 305.406125
0.000000 0.000000 1.000000 0.000000

I also read the corresponding information in the documentation, but it is still not clear to me how to extract this information. Any help is greatly appreciated!

Cheers!


Originally posted by britney on ROS Answers with karma: 1 on 2014-05-17

Post score: 0


Original comments

Comment by Introcert on 2017-08-07:
Hi my friend, I have the same question recently. I noticed that you asked this question 3 years ago, so I wonder if you can tell me about how you solved this question? Thanks a lot !

Comment by pointsnadpixels on 2018-01-11:
Same here. If either of you have found out how to get that information, please let me know

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

By convention, the projection matrix has the following format :

[fx' 0 cx' Tx] [ 0 fy' cy' Ty] [ 0 0 1 0]


You can find more informations on the cameraInfo.msg definition :

By convention, this matrix specifies the intrinsic (camera) matrix of the processed (rectified) image. That is, the left 3x3 portion is the normal camera intrinsic matrix for the rectified image. It projects 3D points in the camera coordinate frame to 2D pixel coordinates using the focal lengths (fx', fy') and principal point(cx', cy') - these may differ from the values in K. For monocular cameras, Tx = Ty = 0. Normally, monocular cameras willalso have R = the identity and P[1:3,1:3] = K. 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 jeanpolochon with karma: 140 on 2017-08-08

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.