Ask Your Question

Camera Calibration : fx and fy

asked 2014-08-11 13:34:54 -0600

LadyUnknowing gravatar image

Hi, can somebody explain why I get focus lenghts fx AND fy? One focal lenght is "normal" for optical instruments using monochrom light. So what is the different of fx and fy? Thanks!

edit retag flag offensive close merge delete


A question, can i compare thees values with the original focal lenght of my camera? My camera has a focal lenght =60mm , and after the calibration in open cv i have fx=38246.8 fy 38074.0 the pixel size is 0,00571

Giancola gravatar imageGiancola ( 2015-06-10 05:01:45 -0600 )edit


how can I get focal length in pixels from fx and fy? I need to get disparity using z = b*f / d,

where z is the depth (in meters), b is the horizontal baseline between the cameras (in meters), f is the (common) focal length of the cameras (in pixels), and d is the disparity (in pixels). At zero disparity, the rays from each camera are parallel, and the depth is infinite. Larger values for the disparity mean shorter distances.

I am using kinect with the focal length: fx_rgb = 5.1885790117450188e+02 * ratio; fy_rgb = 5.1946961112127485e+02 * ratio;

Kinect is not a stereo sensor, therefore I dont have a "baseline".

Please help Ayesha

ayeshas gravatar imageayeshas ( 2016-03-29 11:25:55 -0600 )edit

^^ @ayeshas , please do not make answers, if you have a question or a comment.

berak gravatar imageberak ( 2016-03-29 12:00:17 -0600 )edit

^^ @ayeshas , please do not make answers, if you have a question or a comment.

berak gravatar imageberak ( 2016-03-29 12:00:28 -0600 )edit

3 answers

Sort by ยป oldest newest most voted

answered 2014-08-18 11:18:21 -0600

You are right that a normal optical instrument has only one focal length. But here, you look at a combination of a lense and(!) a sensor that consist of a 2d-array of detectors (formerly known as pixels). Your focal length therefore has the unit meters/px. If your camera's pixel pattern is a perfect square, fx equals fy. If the pixels are a bit rectangular and not quadratic, fx differs from fy. This effect can be captured by using two different focal lengths.

There is even a version of the intrinsic calibration where there is a skew value that incorporates an angle between the rows and columns of your pixel array that is not 90deg.

edit flag offensive delete link more

answered 2014-08-12 02:35:24 -0600

If you need more explanation about the theory, have a look at the first section of the calibration tutorial here. It will explain why fx and fy are needed.

But basically, as @Ziyou said, it's because image are not square (I should say not spherical) but a rectangle. Therefore, you need an estimation of the focal on Height and the focal Width.

edit flag offensive delete link more

answered 2014-08-11 19:10:45 -0600

Ziyou gravatar image

An image has two dimensions, thus have two focal length values.

edit flag offensive delete link more

Question Tools


Asked: 2014-08-11 13:34:54 -0600

Seen: 12,283 times

Last updated: Mar 29 '16