43

In the pinhole camera model there is only one focal length which is between the principal point and the camera center.

However, after calculating the camera's intrinsic parameters, the matrix contains

(fx,  0,  offsetx,  0,
 0,  fy,  offsety,  0,
 0,   0,  1,        0)

Is this because the pixels of the image sensor are not square in x and y?

Thank you.

FvD
  • 1,286
  • 13
  • 25
binzhang
  • 1,171
  • 4
  • 12
  • 22

1 Answers1

43

In short: yes. In order to make a mathematical model that can describe a camera with rectangular pixels, you have to introduce two separate focal lengths. I'll quote from the often recommended "Learning OpenCV" (p. 373) which covers that section pretty well and which I recommend getting if you would like more background on this:

The focal length fx (for example) is actually the product of the physical focal length of the lens and the size sx of the individual imager elements (this should make sense because sx has units of pixels per millimeter while F has units of millimeters, which means that fx is in the required units of pixels). [...] It is important to keep in mind, though, that sx and sy cannot be measured directly via any camera calibration process, and neither is the physical focal length F directly measurable. Only the combinations fx = F*sx and fy = F*sy can be derived without actually dismantling the camera and measuring its components directly.

FvD
  • 1,286
  • 13
  • 25
  • Thanks a lot, especially for "learning opencv" recommendation. – binzhang May 06 '13 at 02:33
  • So, if i want to use F and I have fx and fy available from the camera intrinsics, how do we know the values of sx and sy? – Megha Oct 19 '18 at 16:46
  • 2
    This statement is actually wrong, and misleading: _"The focal length fx (for example) is actually the product of the physical focal length of the lens and the size sx of the individual imager elements"_. fx and fy are measured in units of **pixels**, so the correct expression is: fx [pixel] = focal_length [mm] / imager_element_length [mm/pixel]. That is, **it's a division, not a product**. It's hard to believe that such an error actually appeared in the Learning OpenCV book, but I don't have a copy around to check... (?). – Jose Luis Blanco Oct 20 '19 at 09:18
  • The Google Books preview confirms that it's actually in the book in that way. Their definition of sx is in [pixel/mm], evidently. @Megha: The values of sx and sy may be given by the camera manufacturer. – FvD Oct 21 '19 at 13:20
  • 2
    @JoseLuisBlanco sx = 10 pixel/mm, f = 35mm, then sx*f = 35mm * 10 pixel/mm = 350 pixels, it is not a division – WhatAMesh Jan 22 '20 at 19:04
  • @WhatAMesh Alright, I understood "sx" as the size of ONE pixel, that is, exactly the inverse of "sx = pixels per millimeter", which is its meaning in the answer above. With that definition, everything is correct. Good! – Jose Luis Blanco Jan 23 '20 at 06:25