A lot of people have asked if we can measure the distance of an object in photo. But I was wondering if we can measure the size of an object in photo. Of course assuming we know everything from sensor size to height of the photographer etc.

Example: If I take a photo of a bird in flight with only sky as background, there would be no objects in the frame to give an idea of size of the bird. So if I could calculate the size to some approximate level, it would be really nice to know.


It would never be more than an estimate, without some external reference or accurate distance to the subject. If you have estimated distance to the subject, FOV (/length of the lens) and the sensor size it's not too hard to calculate. The biggest uncertainty would be the distance to the subject.

To find the spatial resolution (how large (wide or high) a pixel is in the subject) use:

(distance*(sensor size / focal length)) / number of pixels

Make sure the sensor size and focal length are using the same scale (both are in millimetres or inches).

Then you can count the number of pixels for the subject, and multiply that with the spatial resolution for one pixle.

I'm assuming a linear change in FOV over the whole area of the lens, which isn't 100% accurate, but quite close for normal and longer lenses.

  • 4
    Too bad we don't have the LaTeX-math working here at photo. – Håkon K. Olafsen May 15 '12 at 7:22
  • 1
  • The equation is wrong. Why 2x? You are calculating an area, therefore, it is squared. It should be distance^2. See photo.stackexchange.com/a/12437/7292 – Rado Jun 7 '14 at 13:09
  • Oh .. and the focal length should also be squared – Rado Jun 7 '14 at 13:49
  • @HåkonK.Olafsen: Observe: sensor_x/focal_length = picture_x/distance; sensor_y/focal_length=picture_y/distance (distance is calculated from the focal point). Considering a square pixel, you can take any of these, and get: picture_x = distance*sensor_x/focal_length. Divide it by horizontal pixel count pixel_cnt_x you get: distance(sensor_x/focal_length)/pixel_cnt_x. This is the horizontal spatial resolution. The "2x" multiplier is not correct. If you have non-square pixels, you will have to do the math for both horizontal and vertical resolution. – TFuto Jun 7 '14 at 15:45

My camera stores the focus distance within the picture. With this you know how far away your bird was. It won't be too hard to calculate the size of the bird. For instance, you can take an object of known size and take a picture with the same lens from the same distance and compare the size of this object in the image, with the size of the bird in the image.

  • 1
    What camera is this? – ysap May 15 '12 at 6:47
  • It's a Nikon D300 – Rene May 15 '12 at 8:15
  • 1
    But doesn't the focus distance go only up to around 3m and then it becomes infinity? When I use the Magic Lantern firmware on my Canon 550D it does at least. – Saaru Lindestøkke May 15 '12 at 8:16
  • 1
    I would be wary of trusting the distance provided by the camera at anything remotely approaching a focus distance of infinity, as the smallest calibration error would yield errors that could be several orders of magnitude of the provided distance. – Michael C Jul 5 '13 at 11:44
  • @BartArondson It depends on the focal length of the lens. A longer focal length, such as often used when birding, will focus much further before it reaches ∞ than a wide angle lens. That is why the last measure before ∞ for distance scales on WA lenses is usually only around 1 meter, but a long telephoto lens will have a marking of over 50 meters or even 100 meters just before the ∞ mark. – Michael C Jul 5 '13 at 11:54

the general answer is: Yes and No, if you add in enough information besides the EXIF info, then it can be done, if you don't add enough info in then no, it becomes an estimate, that info is an extremely complex calculation of the perspective of the object, but then also using that to work back to the format and angle of the photo frame, then an exact measurement to the person's eye or frame center (in elevation from the ground), then knowledge of the exact ground surface elevations between you and the object. and even more calculations beyond that.

An important step that the other answers are leaving out, is that you must use the data in the photo to find the perspective angles of horizontal and vertical lines on that object your photo is of, (which actually can be done, but is an extremely complex calculation), and even more complex if for instance in the OP's example of few objects in the photo to work with, however it still can be done, for instance in this case, if the object is not sitting "level" on the ground, then the height info is also needed. In the OP's example much of that info is probably left out/or unknown, so an answer can be No in that example case. But to be clear, the premise of the question is doable, if that extra info is known, and many times it is known, or estimates can be made of that info.

To sum up how (in general) this can be done: one needs an exact measurement of the ground surface elevation changes between you and the object, (there is more to it than just that one sentence).

then you need an exact dimension from ground to the center of your eye, or the center of the image frame that the camera is producing, this image frame can be calculated from the EXIF info, but the exact tilt of the image frame (camera) in relation to the object needs to be calculated from that perspective info mentioned before. And in the case of the OP's example, the height of the object off of the ground is needed (or the projection of that object back to the ground)

to show it can be done in a more general example photo, An app that does all this is below: (except it is using estimates for center of eye, and does a complex calculation of ground surface elevs, which also becomes an "estimate")

so since it is using estimates, you need to know one dimension of the object to correct the final output of the app. but that is far better than having to take a tape measure to everything on the object. To be clear, if the app had the exact dimension to the eye, or image frame center, and a profile of the ground surface changes, then it wouldn't even need that "one known dimension". so in that case, the answer to the OP question would be Yes.

the final output is a perspective corrected "elevation" of the object, and even with automatic dimensions. (notice this image has been perspective corrected so all verticals are vertical, horizontals are horizontal, and this is done automatically with no input from the user) This perspective corrected image is not needed for the calculation of size, but the perspective correcting info IS needed, that is used to find the angle, (yaw tilt, etc) of the image frame. (how the camera was sitting at the moment of the photo) this is what I want to emphasis is needed that the other comments have been leaving out. In the case of a "bird" as in the OP example, one is going to be pretty much left high and dry for this needed data, but in many situations it can be worked out. For instance this example below.

enter image description here


  • I don't think this in any way answers the question. This app just computes relative lengths of things when one length is known. The question relates to working out the size of something, like a bird, from EXIF type info such as focal length, focus distance etc. – MikeW Dec 19 '15 at 20:13
  • I mentioned how to work out the size of something in the comments, and then mentioned that this app does this, but uses "estimates" for some of those important pieces of data that the comments call out for.... and why the app needs "one known length" to correct because of those "estimates" used, if you have exact info in those key areas as mentioned in the comments, then this app wouldn't need the "one known length", and it also does several of the steps needed, including steps that the other comments had left out, like working backwards to find the tilt and yaw of the image frame. – hokkuk Dec 19 '15 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.