How to convert stereo camera distances, pixels to mm [closed]

Hello.

I calibrated and stereo-parallelized the stereo camera.I would like to know how to find the coefficient to convert from pixels to mm.

From the Q matrix obtained by stereo rectification, Tx: baseline and f: focal length were determined. As you know, the depth z is found by the following formula

z = Bf/(x-x') z:[pixels]

However, the units of z obtained from this formula are pixels. A factor k[mm/pixel] is needed to convert it to mm. Then the equation is as follows

z = (Bf/(x-x'))*k z:[mm]

Is there a smart way to find this coefficient k? Please use something other than how to actually measure z several times to derive k, or how to examine the pitch pixels of the camera's image sensor.

In the case of HALCON, I was able to find it by a function instead of using the method described above.

Couldn't it be calculated from the camera and Q matrices obtained from calibration and stereo parallelization? Thank you.

edit retag reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by yoshihiko close date 2020-09-26 17:45:01.852004

Sort by ยป oldest newest most voted

Pixel shear is not defined either, so opencv is useless.

more

( 2020-09-26 09:00:45 -0500 )edit

I didn't know there was such a useful function. Thank you.

( 2020-09-26 17:43:25 -0500 )edit