Ask Your Question
0

stereo_calibration - rotation and translation matrix from output?!

asked 2014-05-17 09:36:31 -0600

britney gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

Comments

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 !

Introcert gravatar imageIntrocert ( 2017-08-07 01:44:30 -0600 )edit

Same here. If either of you have found out how to get that information, please let me know

pointsnadpixels gravatar imagepointsnadpixels ( 2018-01-11 00:44:51 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-08-08 02:21:21 -0600

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-05-17 09:36:31 -0600

Seen: 872 times

Last updated: Aug 08 '17