Determining the focal length, image center, baseline and field of view measurements for stereo vision cameras

Last Revision Date: 7/7/2015

This article describes how to obtain information on focal length, image center, baseline and field of view measurements for our stereo vision camera using API function calls and calculations.

Calibration files are embedded in all stereo vision cameras. Your camera’s focal length (in pixels), image center (also in pixels) and baseline (in meters) measurements can be determined using the Triclops library functions:

triclopsGetFocalLength()
triclopsGetImageCenter()
triclopsGetBaseline()

The focal length represents the distance from the focal point of the camera to the center of the image. The focal length determines the angle of coverage of the lens. The longer the focal length, the narrower the angle of coverage; the shorter the focal length, the wider the angle of coverage.

The image center is the point in the image where the "optical axis" of the lens intersects the image plane. It is not the center of the raw or rectified image, but rather the center of the projective distortion. The optical axis is perpendicular to the image plane. The disparity image is aligned, pixel by pixel, with the right (reference) camera image. Therefore, it has the same optical axis as the right image.

The field of view is the width and height of the scene as viewed by the lens.

The printconfig example in the Triclops SDK gets and prints the baseline (in centimeters) and focal length of the currently connected camera. You can access the example from Programs → Point Grey Research → Triclops Stereo Vision SDK → src → examples → common → printconfig. The resulting values depend on the resolution in which stereo processing is done. It is relatively easy to modify this program to get and print the image center as well. Note: the focal length and image center only apply to the rectified images, not the raw images.

You can then use the following formulas to calculate the horizontal and vertical fields of view:

HFOV = 2 * arctan( w / 2f )
VFOV = 2 * arctan( h / 2f )

where f is the focal length, w is the width (e.g. 320) and h is the height (e.g. 240).

If reading the focal length directly from the camera calibration (.cal) file, the Focal Length listing has two numbers. To calculate f for the above formula, multiply the first number listed (e.g. 0.845263) by the number of columns in the image (e.g. 320). This gives the focal length in pixels, which will be the exact same number as the one returned by 

triclopsGetFocalLength()