measuring distance between objects of known size in photo

by HughT
Tags: distance, measuring, objects, photo, size
 P: 7 Hi. I'm wondering if it's an acceptable method of measuring distance between two objects of known size by averaging their scales. In my case I have a photo of birds on the water. Each bird is known to be about 37cm long. I want to find the distance between two of them on the photo, the nearest one is at a scale of 1cm:37cm, and the second, farther in the distance, is 0.5 cm:37cm. On the photo, they are 7 cm apart. I've figured the average scale is 1:56 (1:37 plus 1:74 / 2) for the two birds, and have computed the distance between them to be 392cm. Does this sound correct? In my case the distance doesn't have to be exact, so if there's an adjustment for vanishing point issues, as long as it's small, it doesn't matter, but please do tell me if such an adjustment is required, if you can. I also tried a "small angles" measure using Kinovea tracking software to determine the angle, but the two methods didn't give me close to the same measure. I suspect I can't use small angles unless the two birds are directly in line with the photographer (which they aren't, in my photo) but I'm not sure. I think my "average-scales" method is more accurate, but I'm not sure if this is a standard method of measuring distance between objects in a photo. Are there any other good methods of measuring distance between objects of known actual size on a photo? Thanks for anyone's help! Hugh
 P: 4,542 Hey HughT and welcome to the forums. For this kind of problem you need a point of reference. The best point of reference IMO would be to use the projection plane. The model that you want to use depends on specific properties of the lense that took the picture, but essentially a good simple model is the perspective projection model. Since you talk about vanishing points, I assume that you have a good intuitive idea (maybe not so much mathematical) for what is involved here. For the absolute most simplest projective model our transform is basically x' = x/z and y' = y/z and z' = 1. This will give the vanishing effect where points at infinity tend to the origin. Now the next step is take your information and use whatever point of reference you are using and get an approximation to where you can get both objects in terms of your projective plane which will ultimately give you the distance information you desire. What I will ask you do in order to aid your help is to draw some kind of diagram with the information you have just so I don't misinterpret it. This will help not only get towards a potential solution, but to also explain what is going on in the calculation.
 P: 7 Hi Chiro. Thanks so much for responding! I've attached a photograph to show what I'm looking for. Hopefully you will be able to access the photo. On it I show a standard measure of a bird (American coot) at 37cm, and the red angle line(s) to the bird I want to find the distance to. The angle shown was just my attempt to try a small angles measure to get the distance, so ignore the angle, but the red lines show the distance I'm hoping to measure. Basically I want determine the area in sq meters so I can figure out the density of this group of birds. I have a good measure of the length, I just need the second dimension to be able to determine the area. Thanks again for your help! Attached Thumbnails
P: 687

measuring distance between objects of known size in photo

Hello, Hugh,
I was going in the same direction as chiro's. Your question falls in the subject called 'photogrammetry' (literally, taking measures on photos). You may do some calculations if you know your camera's CCD sensor size, for which you may consult your camera's specifications and compare with this link:
http://www.dpreview.com/news/2002/10/7/sensorsizes

And you will need the focal distance of the lens you used to take the photo. If it is a fixed lens, that's easy: you'd know if it is a 55 mm lens, or whatever. But if it is a zoom lens, you're going to be in trouble, as you won't remember how did you manually move the zoom position. Unless the photo has digital information recorded on it (EXIF data records added to a JPEG photo, for example), where the actual focal distance has been recorded when the photo was taken.

If you happen to have all this data, then you can imagine each pixel on the photo to be a 'ray' (a line that comes out of the focal point of the lens, passes 'through' the photo, and hits the bird in the world outside). The actual bird position is anywhere along that line; but you can estimate it as you know the real bird's size. The calculations hinted by chiro then would take place.

The objective of these calculations is to obtain three-dimensional coordinates of the bird's position in the 'world' outside the camera; then it is a simple matter to calculate the distance between two of these points in the 'world'.
 P: 4,542 Due to Dodo's post I will wait for the OP to respond if they have information about zoom and lense information. Also to the OP it's been a while since I did this kind of thing (computer graphics, games design) so I don't know how I'll go!
 P: 7 Hi Dodo and Chiro. Funny coincidence about your moniker, Dodo - coots look a bit like a small version of the old extinct bird when you see them walking. Perhaps Dodos are considered to have been a large rail bird (I'm not a bird expert, but am interested in collective phenomena, and coots display some amazing self-organized collective behavior). And no worries, Chiro - any help is great! I have some lens/focal below, which I hope will help. Although if I don't have enough info below to do calculations, I still wonder if averaging scales gives a reasonable basis for a distance measure (?) The photo is a still shot from a video recording I took. I could find the following information from the JPEG: Dimensions w 639 H 347; Horizontal Resolution 96DPI; Vertical 96DPI; Bit depth 24; 35mm Focal Length. The zoom is an automatic adjustment and there appears to be no information about the zoom range for the photo itself, if that is pertinent. The manual for my Panasonic HDC-sd80pc/pc gives the following sensor information, below. Image sensor: 1/5.8z 1MOS image sensor Total; 1500 K Effective pixels; Motion picture; 1300 K to 1120 K (16:9) Still picture; 970 K (4:3), 1100 K (3:2), 1300 K to 1120 K (16:9) Lens: Auto Iris, 34k Optical Zoom, F1.8 to F4.0 Focal length; 2.38 mm to 81 mm Macro (Full range AF) 35 mm equivalent; Motion picture; 33.7 mm to 1240 mm (16:9) Still picture; 41.3 mm to 1405 mm (4:3), 38.1 mm to 1298 mm (3:2), 33.7 mm to 1240 mm (16:9) Minimum focus distance; Normal; Approx. 3 cm (1.2q) (Wide)/Approx. 1.6 m (5.3 feet) (Tele) Tele macro; Approx. 70 cm (28q) (Tele) Intelligent auto Macro; Approx. 1 cm (0.4q) (Wide)/Approx. 70 cm (28q) (Tele) Zoom: i.Zoom OFF 37k, 42k i.Zoom, 90k/2000k Digital Zoom (Using image sensor effective area) Image stabilizer function: Optical (Hybrid Optical Image Stabilizer, Active Mode, Optical Image Stabilizer Lock Function)
P: 687
Hi, Hugh,
 Quote by HughT The zoom is an automatic adjustment [...]
Probably not. Surely you pressed some buttons to choose whether you see a wide panorama, or to close your interest at some area far away.
 Quote by HughT [...] and there appears to be no information about the zoom range for the photo itself, if that is pertinent.
If you took the information below from the photo itself, the "35mm focal length" should be the indication needed.
 Quote by HughT The photo is a still shot from a video recording I took. I could find the following information from the JPEG: Dimensions w 639 H 347; Horizontal Resolution 96DPI; Vertical 96DPI; Bit depth 24; 35mm Focal Length.
You should upload an unmodified photo. The one you posted before has been modified, and even the size in pixels of the photo does not match the 639 x 347 pixels that you report it to be.

It would also be helpful if you give a subjective indication of whether you were photographing a wide panorama of the whole area or, rather, closing in a few birds far away (were you "zooming-out" or "zooming-in", respectively?). (It will probably be apparent from the photo, but your memory will help.)

P.S. Are you sure the 639 x 347 pixels correspond to an original still directly from the camera? I would have expected something larger, something like 1920 x 1080 pixels (these numbers could change, as the size appears to be settable).
 P: 7 Hi Dodo. Yes, actually you are right, I know now that I did use a zoom button to zoom in a fair bit for the photo. I went back to the video and have re-captured two photos that I can use for my analysis. One is not exactly the same still as the one before, but close. For that one I was using very little zoom, perhaps 2 - 3X, while the close-up was from about the same distance away, but using quite a bit more zoom, possibly the maximum. Either one or both (preferably both) would do for me to find distance between nearest and farthest birds, so as to ultimately approximate density. Let me know what other info my help. Attached Thumbnails
P: 687
Ah, thanks, Hugh.
One problem is that I can't find information inside the photo, like the one you mentioned before,
 Quote by HughT Dimensions w 639 H 347; Horizontal Resolution 96DPI; Vertical 96DPI; Bit depth 24; 35mm Focal Length.
How did you find this data for the other photo, and what would be the data for these two? I can see the size, which is fine this time (1280 x 720, so proportions 16:9), but the "focal length" for each photo is critical.
 P: 7 Sorry, I thought 35mm would be standard for the photos so I neglected to confirm. I've just checked the Properties for both jpegs and yes, they are both 35mm. The properties indicate that the dimensions are w1920 X h1080 for both, however; 72dpi for horizontal and vertical resolution, bit depth 24, and EXIF is 0230. Thanks again for your help! Much appreciated!
Sci Advisor
P: 2,892
 Quote by HughT have computed the distance between them to be 392cm. Does this sound correct?
It isn't clear to me how you computed the distance. Are are referring to the distance between them in 3 dimensional space? Did you estimate the range to each bird, and the angle between them and use geometry to calculate the distance? Or are you referring to distance in some 2 dimensional space, as if the image were a photographic print?
 P: 687 He figured that, if one bird appears scaled down to 1/37th its size, and the other to 1/74th, then he could imagine both scaled down to 1/56th ((37+74)/2 = 55.5), and then the apparent 7 cm. distance between them would be 7x56 = 392 in reality. The problem is that, even if everything is on the same plane to begin with, the red line in the figure below can be much shorter than the green line (and, the more zoom he's using, the narrower the field-of-view angle and the more error you will incur on not really; the lines were meant as toward objects in the world, and have nothing to do with field of view or the photo's properties. Sorry for the brainflop.). (BTW, do we have the 'picture' and 'color' packages in out LaTeX here?) Then I stepped in with stuff I have done before at work (but with equipment that can provide more data than we could have here), and probably overcomplicated the issue. I plead guilty. :) I was weekend-working on a computer program, just for fun, that could help to have an idea of the distance (and possibly with how much error). But with so many guesses, this can end in a garbage-in-garbage-out, purely bogus value, so please bear not much hopes for validity.
 P: 7 Thanks Stephen and Dodo. I would be happy with a reasonable approximation, as long as the method is supportable (would want to refer to it in a potentially publishable paper). Does it help if I find two birds that align at 90 degrees, as shown in my new attachment? Again, we can assume both birds are 37cm long. Also, when video'ing, I was on my knees, and I've just measured my eye-level at 122 cm (an approximation to be sure given that I may have been crouching slightly). Attached Thumbnails
 P: 687 I think a simple idea would be to use two coots which are horizontally at the same level in the photo, and that have the same size (so they are at the same distance from you). Then you can use your proportionality method (and be able you justify it yourself in your paper) to estimate the distance between the two birds. But estimating distances in the back-to-forth axis, that will not be that simple. Another recommendation I would do is to make the measurements on the photo in 'pixels' (any paint program should be able to tell you pixel coordinates as you move or click the mouse). All units on the photo must be the same (f.i. pixels), and then all units in the real world must be the same (for example, centimeters); but there is no need for the units in both photo and world to be the same. And measuring in pixels on the photo will give you far more accuracy than trying to use a ruler on such small distances in the photo.
P: 4,542
 Quote by Dodo I think a simple idea would be to use two coots which are horizontally at the same level in the photo, and that have the same size (so they are at the same distance from you). Then you can use your proportionality method (and be able you justify it yourself in your paper) to estimate the distance between the two birds. But estimating distances in the back-to-forth axis, that will not be that simple. Another recommendation I would do is to make the measurements on the photo in 'pixels' (any paint program should be able to tell you pixel coordinates as you move or click the mouse). All units on the photo must be the same (f.i. pixels), and then all units in the real world must be the same (for example, centimeters); but there is no need for the units in both photo and world to be the same. And measuring in pixels on the photo will give you far more accuracy than trying to use a ruler on such small distances in the photo.
The only measure of caution I would add here is if there is some whacky stuff going on with the lense like say a fishbowl effect or something akin to that kind of thing.

My guess is though for all practical purposes this is not the case with the OP's example.
 Sci Advisor P: 2,892 HughT, What you need is some object in the picture which is a known distance from the camera. What you get from the dimensions of two birds B1 and B2 is an estimate of the ratios their distances D1 and D2 from the camera. B1/D1 = B2/D2. You don't have enough information to find D1 and D2 or D2 - D1.
P: 687
 Quote by Stephen Tashi What you need is some object in the picture which is a known distance from the camera.
By the way, one of such possible objects is the image sensor itself - which is why focal distance (which we don't have) and sensor size (which we can guess) are important.

By-the-way-2: a still photo (not a video grab) with the same camcorder (for which we have sensor information) could help, as still photos usually have the required information inside; in data headers that can be queried, for example, here: http://regex.info/exif.cgi
 P: 7 Thanks for everyone's help on this. Unfortunately I didn't take any still photos of the scene, and, being on the water on an stand-up paddle board, it's not possible to for me go back to physical location and retrace distances to any landmarks in the photo. I do know better what what information to get for the next similar shoot, thanks to everyone here. As it seems the problem is rather intractable for the images I have, I've decided to use a perspective grid (see attachment) that somewhat applies my "scale-averaging" notion earlier. It still involves a fair amount of eye-balling but it gives me a standard I can apply to other video-stills, whereby I match a grid unit to the size of a near bird and then adjust the grid so that a grid unit in the distance will roughly scale-map over a bird of similar orientation in the distance. It's rough it to be sure, but it gives me some way to indicate density. If it doesn't work for the editors/peer-reviewers, I can always just omit and say that I haven't been able to accurately measure density. θ-) Attached Thumbnails

 Related Discussions Introductory Physics Homework 1 Cosmology 5 Introductory Physics Homework 2 High Energy, Nuclear, Particle Physics 1 General Astronomy 7