kenneth
kenneth

Reputation: 167

how to estimate baseline using calibration matrix

is there any possibility to calculate the baseline value of two cameras if the 4 by 4 calibration matrix of both cameras are given? will the baseline value calculated in meter or milimeter?

Hope anyone can help me pls ? TT

Upvotes: 2

Views: 4660

Answers (2)

Kyle Simek
Kyle Simek

Reputation: 9636

Be careful not to confuse your reference frames when subtracting translation vectors. If your extrinsic matrix is [R | t], taking the Euclidean distance between t1 and t2 will not give you the baseline. This is because t is the position of the world origin on camera coordinates, and the reference frame is different for each camera. Subtracting vectors with different reference frames is an invalid operation.

What you want is the difference between the two cameras' centers in world coordinates, i.e. |c1 - c2| where c = -R't.

These reference frame issues in the extrinsic matrix can be subtle and confusing. For a longer discussion on the topic, check out this blog I wrote last year. It includes an interactive demo that illustrates how t and c differ.

Upvotes: 3

devrobf
devrobf

Reputation: 7213

You need to specify what kind of calibration matrix you have. If you are saying that you only have the internal (or intrinsic) calibration parameters, then the answer is no - the calibration matrices simply define the relationship between pixels and the world, not between cameras. The relationship between two cameras in a stereo system is defined by the external parameters, which defines the rotation and translation of the cameras in the world. There is a good reference here, which I suggest you read.

EDIT: If you have the external parameters, you will see in the link I gave that they are represented by the transformation matrix K:

K = [ R_11 R_12 R_13 t_1 ]
    [ R_21 R_22 R_23 t_2 ]
    [ R_31 R_32 R_33 t_3 ]
    [ 0    0    0    1   ]

So you can directly extract the translation vector t from this, which will give you the distance between the cameras. I can't tell you if they'll be in metres or millimetres, that depends on where you got the matrix from. It should tell you if it is to scale.

Upvotes: 2

Related Questions