Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find camera's intrinsic matrix from focal length?

I have calculated focal length in pixels using:

Focal length in pixel = (focal length in mm × image dimension in pixels)/sensor size in mm

How do I compute the camera's internal matrix now?

I was trying this but i am not sure if this is correct, and also I don't know how to proceed further

| fx  0  cx | 
| 0  fy  cy | 
| 0  0   1  | 

I was trying to find out this using the data collected from the image's metadata and the image was obtained from a dataset.

like image 880
Aayusha Odari Avatar asked Nov 19 '25 15:11

Aayusha Odari


1 Answers

You need to calculate:

focal length [pixels] =
    focal length [mm] / sensor pixel size [µm/pixels]

sensor pixel size [µm/pixels] =
    sensor size along one edge [mm or µm] / pixels along that edge [pixels]

(So, rearranging, your formula appears to be correct. Check your numbers then.)

If you only have the diagonal size, then you need to calculate the number of pixels diagonally. Pay attention to aspect ratios, various figures are given for full sensor size or for video modes (often 16:9)

Example:

focal length [pixels]
    = (5 mm) / (2 µm/px)
    = 2500 px

Just plug that in for fx, fy.

As for cx, cy, you can assume that point to be in the center of the image/sensor area but a calibration can give you a better estimate. When pixel centers are integer coordinates and the top left pixel is 0,0, then you will need these floating point values:

cx = (width-1) / 2
cy = (height-1) / 2
like image 187
Christoph Rackwitz Avatar answered Nov 21 '25 09:11

Christoph Rackwitz