Good Day
I am trying to measure the width of an object in a photo as accurate as possible using the formula found in a previous question.
Distance to object(mm)=f(mm) x real height(mm)x image height(pixels)/object height(pixels)x sensor height(mm)
I change the real height to real width and the sensor height to sensor width.
The problem I am having is that when the object distance is small the object measure more than what it measures in real life and when the distance is larger the object measure much less than what it measure in real life. Is there anything I can add to the formula to help resolve this. I need very accurate measurements.
Here is examples of what I did.
I know the object is 1047.75 mm wide in real life...
The lens I use is a Canon L-Series 70-200 mm
Example 1:
When I take a picture of the object I get the following
Distance to object = 5374 mm (I take the distance from the beginning of the lens to the object)
Focal length = 80 mm (Get it from exif data)
Image width = 5472 pixels
Sensor size (width) = 35.9 mm (Specifications from camera)
Object width in photo = 2554 pixels
Calculation:
Real width = 5374 mm x 2554 pixels x 35.9 mm / 80 x 5472 pixels
Real width = 1125.58 mm (I need to get as close as possible to the real width)
The object measures 77.83 mm more than what it measure in real life
Example 2 (distance increase)
Distance to object = 13 509.10 mm (I take distance from beginning of the lens to the object)
Focal length = 200 mm (Get it from exif data)
Image width = 5472 pixels
Sensor size (width) = 35.9 mm (Specifications from camera)
Object width in photo = 2329 pixels
Calculation:
Real width = 13 509.10 mm x 2329 pixels x 35.9 mm /200 x 5472 pixels
Real width = 1032.08 mm (I need to get as close as possible to the real width)
The object now measures 15.67 mm less than what it measure in real life.
Is there any add on to the formula to solve this? What else can I try to get closer to the real width? I know the difference is very small, but I need the difference not to be more than 3.5 mm.
I will highly appreciate help to solve this.
Thank you