Intrinsics Configuration File

The intrinsics configuration file (intrinsics.ini) is a simple text file used for specifying the intrinsics of the left and right cameras:

# Camera Intrinsics
# The following models are supported:
# 0: OpenCV Pinhole Model
# 1: OpenCV Fisheye Model
i1_model =  0
i1_fx =  5368.72291
i1_fy =  5368.72291
i1_cx =  1458.95296
i1_cy =  936.28799
i1_k1 =  -0.13332
i1_k2 =  0.98883
i1_k3 =  -5.9473
i1_k4 =  0.0
i1_k5 =  0.0
i1_k6 =  0.0
i1_p1 =  0.001
i1_p2 =  0.00053
i2_model =  0
i2_fx =  5370.75916
i2_fy =  5370.75916
i2_cx =  1431.27415
i2_cy =  935.70973
i2_k1 =  -0.13181
i2_k2 =  0.80715
i2_k3 =  -3.7122
i2_k4 =  0.0
i2_k5 =  0.0
i2_k6 =  0.0
i2_p1 =  -6e-05
i2_p2 =  -0.00035

Camera Model

i1_model and i2_model: Defines the type of camera model used.

Camera Assignment

  • Camera 1 (i1_): Left camera
  • Camera 2 (i2_): Right camera

Focal Length

i1_fx, i1_fy and

i2_fx, i2_fy

  • Defines the focal length of the camera in pixels.

Principal Point

i1_cx, i1_cy and

i2_cx, i2_cy

  • Defines the principal point (optical center) of the camera in pixels.

Radial Distortion Coefficients

i1_k1, i1_k2, i1_k3, i1_k4, i1_k5, i1_k6 and i2_k1, i2_k2, i2_k3, i2_k4, i2_k5, i2_k6

Radial distortion coefficients have different meaning in the pinhole model and in the fisheye model.

Pinhole Camera Model

The radial coefficients describe how light rays deviate from an ideal pinhole projection due to lens distortion. Radial distortion causes straight lines to appear curved.

\[ r_{distorted} = r \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}, \]

where \(r\) is the radial distance from the optical center.

  • k1, k2, k3 are the primary coefficients for standard distortion correction.
  • k4, k5, k6 are higher-order coefficients for finer correction. They are useful particularly for wide FOV lenses.

Fisheye Camera Model

The fisheye model follows Kannala-Brandt distortion model, which differs from the pinhole model in several aspects. It incorporates only the first four distortion coefficients k1, k2, k3, k4 . The radial distortion function is

\[ \theta_{distorted} = \theta \Big( 1 + k_1\theta^2 + k_2 \theta^4 + k_3 \theta^6 + k_4\theta^8\Big), \]

where \(\theta\) is the angle of the incoming ray relative to the optical axis.

The fisheye model better captures large distortions at wide angles and is best used for cameras with very wide FOV (\(FOV >100^\circ\)).

Tangential Distortion Coefficients

i1_p1, i1_p2 and i2_p1, i2_p2

  • Defines the tangential distortion, which occurs when the camera lens is not perfectly parallel to the image sensor.
\[ x_{distorted} = x + [2p_1 xy + p_2 (r^2 + 2x^2)], \quad y_{distorted} = y + [p_1(r^2 + 2y^2) + 2p_2 xy], \]

where \((x, y)\) are the idealized undistorted coefficients and \(r^2 = x^2 + y^2\) is the radial distance from the optical center.

Note: Tangential distortion applies only to the pinhole camera model!