Real Time 3D Reconstruction from Monocular Video

Pinhole camera model

A camera can be approximated by a projective model. We use the classic pinhole projection which models how a 3D world point is projected over the image plane of the camera. The camera is modeled as a light sensible surface composed by the following elements:

  • an image plane where the image is discretized in pixels
  • a focal plane, in which the image is projected
  • a lens with a focal length, center of projection and radial and barrel distortions
  • a camera frame, with a position and orientation in space

pinhole

The projection is represented by two set of parameters called intrinsic and extrinsic parameters. Intrinsic parameters allows to model the optic component considering distortions and aberrations introduced by the lens in the image. Extrinsic parameters represent the camera position and orientation. Then, the projection matrix $\mathbf{P}$ can be decomposed into two basic matrices:

In a more compact matrix notation:

Intrinsic parameters

The calibration matrix of a camera $\mathbf{K}$ is expressed in terms of the intrinsic parameters of that camera:

  • $k_u, k_v$ is the scale factor relating pixels to distance (often equal to 1)
  • $f$ (the focal length) is the focal distance between focal and image plane
  • $u_0, v_0$ is the principal point (ideally in the center of the image)

The calibration matrix allows to establish a relation between the fundamental matrix $\mathbf{F}$ and the essential matrix $\mathbf{E}$ according to @hartley2003multiple

Extrinsic parameters

  • $R$ is the rotation of the camera in space
  • $t$ is the translation of the camera
  • $C$ is the position of the camera in world coordinates

Calibration

Intrinsics parameters for a given camera can be computed using the algorithm from @zhang2000flexible implemented by OpenCV. Lens transforms a point $r$ in the theoretical image plane into a point $r'$ over the real image plane according to the FOV-model as it was explained by @devernay2001straight. The next equations describe how distortions affect pixel coordinates:

Disparity to depth matrix

There is $4 \times 4$ matrix which allows to recover the world 3D point from the image pixels $(x, y)$ combined with the $d$ obtained from the disparity map calculated with stereo correspondence.

where $(c_x, c_y)$ is the principal point of the camera, $T_x$ is the baseline between the two cameras and $f$ is the focal length in mm.

References