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.
You need to calculate:
(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:
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 is0,0, then you will need these floating point values: