Skip to content

5. Equation and Coordinate System Definitions_All

Jenna Brown edited this page Jul 1, 2020 · 1 revision

Coordinate System Definitions

Note: World can be either coordinate system, local or geographical. However, in order to work, extrinsics and points in question need to be in same coordinate system. I.E. you cannot use the projective matrix on geographic points when extrinsic re defined in local and vice versa.

Nomenclature Coordinate System
XYZC Camera
xyz Camera Homogeneous
XYZWL World Local
XYZWG World Geographical
XYZW World: Either Local or Geographical
UVD Image Distorted (lens calibration applied)
UV Image Undistorted (no lens correction; assumes pinhole camera model)

Local and Geographic World Coordinates

Figure13

Figure 13: Relationship between World Coordinate Systems, Geographical and Local

Extrinsics

Eqn1

where
CXW, CYW, CZW Position of Camera Coordinate System origin (Camera Position) in World coordinates
alpha Azimuth: The horizontal direction the camera is pointing and positive CW from World Z Axis.
t Tilt: The up/down tilt of the camera. 0 is the camera looking nadir, +90 is the camera looking at the horizon right side up. 180 is looking up at the sky and so on.
s The side to side tilt of the camera. 0 degrees is a horizontal flat camera. Looking from behind the camera, CCW rotation of the camera would provide a positive swing.

Figure14

Figure 14: Definition of extrinsic vector in world coordinates.

Image and Camera Coordinates

Figure15

Figure 15: Relationship between Camera XYZC, Homogeneous Camera xyz, and undistorted Image (UV) coordinates.

Projection Matrix Construction

The projection matrix to go from XYZW to UV coordinates as defined above is:

Figure16

Figure 16: P Matrix Construction to go from World to undistorted Camera Coordinates.

Where

  • K is matrix to go from camera coordinates to UV undistorted coordinates. (It combines the matrices to go from camera to camera homogeneous and camera homogeneous to Image).

  • R is rotation matrix to go from world coordinates to camera coordinates. It is a ZXZ rotation with azimuth, tilt, and swing respectively and is defined in the next section.

  • T is the translation matrix to go from world coordinates to camera coordinates

Rotation Matrix Definition

To construct R, we need to rotate the World Axes to match the Camera Axis in a ZXZ rotation. With azimuth, tilt, and swing (A,T,S) or (a,t,s). The camera axis is defined in Figures 14-15.

Figure17a

Figure17b

Figure17c

Figure 17: ZXZ Rotation formulation of World to Camera R Rotation Matrix

The top panel in Figure 17 shows the camera axes as if it were looking down (T=0) with a positive Azimuth A (Defined as positive CCW about X_C or in other words positive CW deviation of Y axes). The top panel shows the following rotation to get the World X axes to match the Camera X axes.

Eqn2

Using fact that cos(180-X)=-cos(x) and sin(180-X)=sin(x).

Looking at the middle panel in Figure 17, Positive tilt is defined as clockwise rotation about Xc or CW Deviation of Yc from the horizontal. (+90 degrees would be the camera looking out to North if A=0). The middle panel shows the rotation to get the World Y and Z Axes to match the camera Axis Y and Z axes.

Eqn3

In the bottom panel in Figure 17 Positive Swing is defined as clockwise rotation about Zc. If you imagine that the camera is up looking at the horizon (Tilt 90); this would be if the camera was rotated counterclockwise looking from the back of the camera.

Eqn4

We then multiply the matrices. Remember, the order of rotation goes right to left!

Eqn5_6_7

So this R_(W→C)=R takes world coordinates (XYZ, and transforms them to Camera Coordinates XcYc,Zc).

Intrinsics and Distortion

The intrinsic vector is defined as the following:

CIRN Intrinsics Variable Caltech Variable Symbol Description
intrinsics(1) nx Number of pixel columns
intrinsics(2) ny Number of pixel rows
intrinsics(3) cc(1) Uo U component of principal point, defined from top left corner of image
intrinsics(4) cc(2) Vo V component of principal point, defined from top left corner of image
intrinsics(5) fc(1) fx U components of focal lengths (in pixels)
intrinsics(6) fc(2) fy V components of focal lengths (in pixels)
intrinsics(7) kc(1) d1 Radial Distortion Coefficient
intrinsics(8) kc(2) d2 Radial Distortion Coefficient
intrinsics(9) kc(5) d3 Radial Distortion Coefficient
intrinsics(10) kc(3) d1 Tangential Distortion Coefficient
intrinsics(11) kc(4) d2 Tangential Distortion Coefficient

The equations for converting undistorted UV image coordinates to distorted coordinates is the following using symbols defined above. The model is defined in [3].

Normalize Distances in homogenous camera coordinates

Eqn8_9

Radial Distortion

Eqn10_11

Tangential Distortion

Eqn12_13

Apply Distortion Correction

Eqn14_15

Convert Back to Image Coordinates

Eqn16_17

Clone this wiki locally