0
\$\begingroup\$

I've already seen the answer about the crop factor.

I'm writing a small software for motion tracking (from two cameras, videos) in 3D space and research. To do that, I need some information about cameras. Sensor size and pixel size relationship is one of them.

For some things, I need the sensor size, for other, pixel size, elsewhere, focal length. I need to understand if and what is the relationship between the two, and is it possible to calculate one or another.

At the moment I have a plain Canon A720 IS. The listed focal length is 5800, sensor size is 1/2,5'' (5.744 x 4.308 mm) and the pixel size i 3,1µm² (~1,76µm). How are these numbers related (mathematically)? Is there a way to calculate pixel size from the sensor/resolution/focal length/whathaveyou?

PS: After calibrating my camera with OpenCV (inaccurately, but close enough for debugging), I got a focal value of 633. This has to be multiplied by sensor size, so I end up with a value of 253,2. How is this related? This is nowhere near 5800µm, Canon-listed focal length, and 4620µm, for which I am getting the most accurate 3D positions.

\$\endgroup\$
12
  • \$\begingroup\$ See What is “angle of view” in photography? for a visual explanation of how focal length relates to sensor size. \$\endgroup\$
    – mattdm
    Jul 14, 2015 at 14:10
  • \$\begingroup\$ possible duplicate of How to calculate the focal length of cell phone cameras when none of the required parameters are available? \$\endgroup\$
    – mattdm
    Jul 14, 2015 at 20:23
  • \$\begingroup\$ @mattdm how is that related to the relationship between pixel size and sensor size? Also, I have focal length, I even have three, the problem is I don't know which one is true. \$\endgroup\$
    – Petersaber
    Jul 14, 2015 at 20:49
  • \$\begingroup\$ Let me step back a bit. How do you think these values might be related? \$\endgroup\$
    – mattdm
    Jul 14, 2015 at 21:00
  • \$\begingroup\$ @mattdm I don't know. That's why I asked in the first place. Pixel size... I don't know. Sensor width/height divided by the amount of pixels on the matrix. However, the matrix is bigger than the picture it takes... isn't it? calibCamera value * sensor size should give me the focal length, but I get different result from that... so that's something I also asked about. \$\endgroup\$
    – Petersaber
    Jul 14, 2015 at 21:09

1 Answer 1

2
\$\begingroup\$

Those numbers aren't directly related in any way:

  • The sensor size is the physical size of the sensor.
  • The focal length is how much the lens is magnifying stuff. Note that the A720 has a zoom lens with a focal length which varies from 5.8 mm (5800 µm) to 34.8 mm.
  • The pixel size is the size of each individual pixel on the sensor. This obviously relates to the overall sensor size, but only by the number of pixels on the sensor. Without that, they're independent numbers.
\$\endgroup\$
9
  • \$\begingroup\$ That's depressing. And sorry, I've missed µm. 5,8mm is 5800µm. \$\endgroup\$
    – Petersaber
    Jul 14, 2015 at 11:44
  • 1
    \$\begingroup\$ @Petersaber It's basic geometry. If that's depressing... well, life is going to be hard for you in general! \$\endgroup\$
    – mattdm
    Jul 14, 2015 at 14:09
  • \$\begingroup\$ @mattdm "Those numbers aren't directly related in any way" - that's depressing. I can't have the users of my app dump the entire specification of their cameras... sure, I can get pixel size, but I need to know the total resolution, and not just the picture, right? And the focal length numbers I got just don't match, doesn't matter how I do them. \$\endgroup\$
    – Petersaber
    Jul 14, 2015 at 20:19
  • \$\begingroup\$ Your alternative is to have a large database of values. How do you imagine this working? \$\endgroup\$
    – mattdm
    Jul 14, 2015 at 20:26
  • \$\begingroup\$ @mattdm user inputs a video with a checkboard, inputs sensor size, OpenCV computes what I need using the checkboard calibration. One of the reasons I am asking this question is to confirm I got the good results. Another option is (both will be included in the end app) user inputs focal length, sensor size, pixel size, (preferably only sensor size, as pixel size varies madly from source to source), and simplefied math takes over. \$\endgroup\$
    – Petersaber
    Jul 14, 2015 at 21:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.