The solvePnP function for opencv outputs vectors to qr codes in units that do not match the input units. However they seem to be able to linearly fit to an actual unit, in this case inches.
I mapped out a grid of measured and calculated values (distance and Z) to google sheets in the link below, where it show a strong linear fit following the function: Arbitrary units = 2.309 *(Actual inches) + .797
The solvePnP function for opencv outputs vectors to qr codes in units that do not match the input units. However they seem to be able to linearly fit to an actual unit, in this case inches.
I mapped out a grid of measured and calculated values (distance and Z) to google sheets in the link below, where it show a strong linear fit following the function: Arbitrary units = 2.309 *(Actual inches) + .797
https://docs.google.com/spreadsheets/d/1kCn6Amgc0mpk455qh3CeFzDHTatWdrZuWhXfCstFoQQ/edit?usp=drive_web