Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert focal length in pixels to millimeter (mm)?

I am using OpenCV calibration method to determine the focal length of my endoscope.

http://docs.opencv.org/doc/tutorials/calib3d/camera_calibration/camera_calibration.html

And I am getting a focal length which is in pixels. But I want this to be in millimeter and I do not know the sensor dimensions. How can I calculate the focal length in millimiter (mm)?

like image 224
j1897 Avatar asked Aug 19 '14 03:08

j1897


1 Answers

Refer to this article, and this answer.

The intrinsic matrix contains 5 intrinsic parameters. These parameters encompass focal length, image format, and principal point. The parameters \alpha_{x} = f \cdot m_{x} and \alpha_{y} = f \cdot m_{y} represent focal length in terms of pixels, where m_{x} and m_{y} are the scale factors relating pixels to distance and f is the focal length in terms of distance.

So if you know the size of the sensor and hence the physical size of every pixel, you can derive the focal length in mm, albeit an approximation. Still best to look up the endoscope's datasheet if you need a more precise number.

like image 109
Zaphod Avatar answered Oct 22 '22 03:10

Zaphod