Skip to content

Intrinsics Math

Intrinsics recover the camera matrix KK and distortion coefficients so raw frames can be undistorted before classification (and before extrinsic solve, which assumes already-rectified images).

K=[fx0cx0fycy001]K = \begin{bmatrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{bmatrix}

Each calibration image contributes:

  • Object points: known 3D checkerboard corners in the board frame (z=0z=0), spaced by square_m on a (9,6) internal-corner grid.
  • Image points: the same corners detected in the photo (findChessboardCorners + cornerSubPix).

OpenCV’s calibrateCamera / calibrateCameraRO estimates KK, distortion, and a per-image board pose by minimizing reprojection error: after projecting object points with the estimated pose and camera model, how far (in pixels) the predicted corners sit from the detections.

Our scripts seed KK from the lens datasheet (focal length and sensor size at 1920×1200) with CALIB_USE_INTRINSIC_GUESS, and typically fix k3k_3 (CALIB_FIX_K3) so the radial model stays k1,k2k_1,k_2 plus tangential terms unless otherwise configured.

seecam_calibration_{l|r}.yaml stores roughly:

  • camera_matrix: KK
  • dist_coeffs: distortion vector
  • reprojection_error: scalar summary from the solve

At runtime, SeeCamManager loads that YAML, builds undistort maps from getOptimalNewCameraMatrix, and (for the right camera) rotates each frame 180°. Extrinsics must use the same runtime pixel space; see projection math.

validate_rect_calibration.py re-detects boards on a held-out split, runs solvePnP with the saved KK/distortion, projects corners, and reports mean / max pixel error. Script target: mean ≤ 1.0 px.

Board poses should span the field of view. Center-only captures leave distortion and principal-point terms weakly constrained even when mean training error is low.

Procedure steps: calibration procedure.