Simple data structure for camera information that includes the image size and camera intrinsic parameters.
More...
Simple data structure for camera information that includes the image size and camera intrinsic parameters.
To clarify the terminology used to describe 2D and/or 3D spaces throughout the class, we use "coordinate system" rather than "frame". This is because the term "frame" has two different meanings in the computer vision field: a synonym of coordinate system, and a snapshot out of consecutively captured images. To ensure the reader will not be confused, we clearly differentiate the use of the terms "coordinate system" and "frame" by using "coordinate
system" to denote 2D/3D spaces and "frame" to denote a captured image.
There are three types of the coordinate systems that are relevant to this class:
 the camera coordinate system
 the image coordinate system
 the pixel coordinate system.
The camera coordinate system expresses a camera's 6D pose relative to the world coordinate system. The camera coordinate system is defined to be Xright
, Ydown
and Zforward
. The Z
axis is also called the "optical axis". Note that each axis in the camera coordinate system is expressed in the upper case, like (X, Y, Z)
to distinguish from those of the image coordinate system which we explain next.
The image coordinate system is the 2D coordinate system made by projecting the camera coordinate system onto the 2D image plane which is perpendicular to the "optical axis". Therefore, the direction of the each axis is xright
and ydown
, and the origin of the image coordinate system is located at the crossing point between the 2D image plane and the "optical
axis". This origin is called the "image center" or "principal point". Note that each axis in the image coordinate system is expressed in the lower case , like (x, y)
.
The pixel coordinate system is also a 2D coordinate system. The main differences between the pixel coordinate system and the image coordinate system are the location of the origin and the direction of the axes. The origin of the pixel coordinate system is at the leftupper corner of the image and the direction of the each axis is the same as those of the image coordinate system. The axes of the pixel coordinate system are expressed using u
and v
, therefore the axes directions are uright
and vdown
.
For more detail including an explanation of the focal lengths, refer to: http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html and https://en.wikipedia.org/wiki/Pinhole_camera_model.
Constructor that sets the image size and vertical field of view fov_y
.
We assume there is no image offset, so the image center (center_x,
center_y)
is equal to (width / 2, height / 2)
. We also assume the focal lengths focal_x
and focal_y
are identical. The horizontal field of view fov_x
is calculated using the aspect ratio of the image width and height together with the vertical field of view:
fov_x = 2 * atan(width / height * tan(fov_y / 2)).
This can be derived from the equations of the focal lengths:
focal_x = width / 2 / tan(fov_x / 2)
focal_y = height / 2 / tan(fov_y / 2)
where focal_x / focal_y = 1
.
 Parameters

width  The image width in pixels, must be greater than zero. 
height  The image height in pixels, must be greater than zero. 
fov_y  The vertical field of view. 