0
votes

Assuming I know the distance between camera and the object. How do I know what each pixel width corresponds to in real life in real world measurement (such as cm/mm).

For a NxM resolution image with focal length of x mm. For a planar object (assume a square) at distance D from the camera, how do I measure the square width in millimeters or cm after doing camera calibration. Also, how do I find what a pixel width corresponds to in real world width (cm/mm)

Can someone explain the procedure and algorithm in detail for the calibration procedure to obtain this?

1

1 Answers

0
votes

You don't need the distance of the camera to an object for that. Given the focal length in mm and the focal length in pixels taken from the intrinsics matrix you can compute the height and width of the sensor as:

sensor_width_mm = sensor_width_px * (f_mm / f_px)
sensor_height_mm = sensor_height_px * (f_mm / f_px)

Note that the ratio (f_mm / f_px) is the size of one pixel in mm.