I downloaded the bundle adjustment data from this link:
original data for bundle adjustment
which is the supporting data for a paper titled: Bundle Adjustment in the Large
I want to use the data for triangulation algorithm testing, which requires 3x4
pinhole camera matrices; however the pinhole cameras were all calibrated into 9 parameters:
e.g.
1.5741515942940262e-02 //first three represent the `R` rotation,
-1.2790936163850642e-02
-4.4008498081980789e-03
-3.4093839577186584e-02// 4~6 are the `t' translation vector
-1.0751387104921525e-01
1.1202240291236032e+00
3.9975152639358436e+02 // the 7th is focal length
-3.1770643852803579e-07 // the last two are radial distortion parameters.
5.8820490534594022e-13.
though there is already a reference on how to recover the R
from the first three numbers:
Rodrigues's vector per the original authors:
description here
I still feel it is difficult for me to understand it, especially the how to recover the R
from the first three numbers. Anyone has suggestions?
Camera Model
We use a pinhole camera model; the parameters we estimate for each camera area rotation R, a translation t, a focal length f and two radial distortion parameters k1 and k2. The formula for projecting a 3D point X into a camera R,t,f,k1,k2 is:
P = R * X + t (conversion from world to camera coordinates)
p = -P / P.z (perspective division)
p' = f * r(p) * p (conversion to pixel coordinates)
where P.z is the third (z) coordinate of P. In the last equation, r(p) is a function that computes a scaling factor to undo the radial distortion:
r(p) = 1.0 + k1 * ||p||^2 + k2 * ||p||^4.
This gives a projection in pixels, where the origin of the image is the center of the image, the positive x-axis points right, and the positive y-axis points up (in addition, in the camera coordinate system, the positive z-axis points backwards, so the camera is looking down the negative z-axis, as in OpenGL).
Data Format
Each problem is provided as a bzip2 compressed text file in the following format.
<num_cameras> <num_points> <num_observations>
<camera_index_1> <point_index_1> <x_1> <y_1>
...
<camera_index_num_observations> <point_index_num_observations> <x_num_observations> <y_num_observations>
<camera_1>
...
<camera_num_cameras>
<point_1>
...
<point_num_points>
Where, there camera and point indices start from 0. Each camera is a set of 9 parameters - R,t,f,k1 and k2. The rotation R is specified as a Rodrigues' vector.