I am trying to calculate the dimensions of an object in an image. This is a sample image I took to get height of blue shirt:
I am following the math from this page with sastanin's answer to How do I calculate the distance of an object in a photo?
The real height of the object is ~90 cm, so \$X=0.9\textrm{ m}\$. I took the image from 92 inches away so \$d=2.3368\textrm{ m}\$. I used a Samsung Note 4 phone to get the image. They have a focal length of 4.8 mm, so \$f=4.8\textrm{ mm}\$. They also have 72 ppi. I emailed myself the image and opened in Photoshop, and measured the pixels of the blue shirt in height, and it came to 1690 pixels.
If I convert it to mm using the ppi, I get \$x=596.19\textrm{ mm}\$.
So then using the equation, I am getting
\$(\textrm{596.1944 / 4.8) }\times\,2.3368 = 290.2473\$ which says the shirt is ~290 m in height.
So there is clearly something wrong with the math here. Does anyone know?
EXIF data:
ExifTool Version Number : 10.01
File Name : 20160715_202056.jpg
Directory : .
File Size : 4.1 MB
File Modification Date/Time : 2016:07:15 22:12:49-04:00
File Access Date/Time : 2016:07:15 22:13:05-04:00
File Inode Change Date/Time : 2016:07:15 22:13:02-04:00
File Permissions : rw-r--r--
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
Make : samsung
Camera Model Name : SM-N910W8
Orientation : Rotate 90 CW
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Software : N910W8VLU1DPE2
Modify Date : 2016:07:15 20:20:55
Y Cb Cr Positioning : Centered
Exposure Time : 1/10
F Number : 2.2
Exposure Program : Program AE
ISO : 400
Exif Version : 0220
Date/Time Original : 2016:07:15 20:20:55
Create Date : 2016:07:15 20:20:55
Components Configuration : Y, Cb, Cr, -
Shutter Speed Value : 1/10
Aperture Value : 2.2
Brightness Value : -1.35
Exposure Compensation : 0
Max Aperture Value : 2.2
Metering Mode : Center-weighted average
Light Source : Unknown
Flash : No Flash
Focal Length : 4.8 mm
User Comment : .
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 5312
Exif Image Height : 2988
Interoperability Index : R98 - DCF basic file (sRGB)
Interoperability Version : 0100
Sensing Method : One-chip color area
Scene Type : Directly photographed
Exposure Mode : Auto
White Balance : Auto
Focal Length In 35mm Format : 31 mm
Scene Capture Type : Standard
Image Unique ID : H16USHH04SA
GPS Version ID : 2.2.0.0
Compression : JPEG (old-style)
Thumbnail Offset : 3318
Thumbnail Length : 7352
Image Width : 5312
Image Height : 2988
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Aperture : 2.2
Image Size : 5312x2988
Megapixels : 15.9
Scale Factor To 35 mm Equivalent: 6.5
Shutter Speed : 1/10
Thumbnail Image : (Binary data 7352 bytes, use -b option to extract)
Circle Of Confusion : 0.005 mm
Field Of View : 60.3 deg
Focal Length : 4.8 mm (35 mm equivalent: 31.0 mm)
Hyperfocal Distance : 2.25 m
Light Value : 3.6