Originally posted by elevenaugust
Seems ok to me. Nicely done!
For the sake of math lovers, it would be nice to fully develop 'theta' in the formula 'd = D(sin(theta))' though.
Sorry for the off-topic, but I think that it would be a good idea for future studies to do a tutorial on how calculate size/distance of a given object
when we have all the technical datas in the camera's EXIFs.
I'll do my part..
1- First step is to find the [lxL] sensor size of the camera
...which is not easy as technical datas are not always released by the manufacturer. For example, for the Iphone 4S, the sensor is, according to
this source, a OV8830 which is a color CMOS
In full 8-megapixel (3264 x 2448) resolution, the OV8830 operates at 24 frames per second (fps) in a 4:3 format and in 6-megapixel (3264 x 1836)
resolution at 30 fps in a 16:9 format. These higher frame rates enable a number of key benefits, including: no image lag for shutter-less designs,
continuous shooting, minimized rolling shutter effect, real-time image capture with no lag between resolutions, and full HD at 30 or 60
Source: Omnivision Manufacturer
For the calculation of the sensor size, we need:
- the pixel size
- the max resolution
Both datas can be found, in our example, in the Omnivision site above.
Pixel size is of 1.4 µm or 0.0014mm
Max resolution is 3264 x 2448
Now let's multiply:
L= 0.0014x3264= 4.5696mm
l= 0.0014x2448= 3.4272mm
So the sensor size if 4.5696mmx3.4272mm
2- Second step is to calculate the FOV:
For this, you need:
- sensor size as calculated above
- focal length of the camera
- some reverse trigonometry maths
l= 3.4272 mm tall (referenced to landscape mode), then half that is 1.7136 mm. Focal length for the iPhone 4s is listed as 4.3 mm. So:
- atan(1.7136/4.3)= 21.727776 degrees from center to top, or 43.455552 degrees top to bottom.
L= 4.5696 mm long (referenced to landscape mode), then half is 2.2848 mm. So:
- atan(2.2848/4.3)= 27.983496 degrees center to side, or 55.966992 degrees left to right
So 55.97 degrees horizontal by 43.46 degrees vertical.
Now, nenothtu, it's up to you!
It should be pointed out that "functional pixel size" isn't the same as the "physical sensor size" in CCDs, which is why you calculated using the
actual pixel dimensions of the sensor.
I took the figure of 49.3 degrees side to side from the photo you had labeled the dimensions on,
which is this one:
Based on that, we have a functional FOV of 43.9 and a pixel width of 769. Each pixel will have an angular resolution of 43.9 deg/769 pixels =
0.0570871 degrees per pixel. Then we need to find out how wide the image of the object is in pixels. If it's perfectly level, we can directly measure
it. If it is at an angle, we have to employ a bit of trigonometry. The formula for straight line distance (in this case the width) in two dimensions
is expressed by d for diameter in the equation:
d = SQRT((x^2)+(y^2))
Where: d is the "diameter"
SQRT is computer short hand for "take the square root of everything that follows this in the parentheses"
x^2 is computer short hand for "X squared", "x" being the distance laterally
Y^2 is computer shorthand for "Y squared", "y" being the distance vertically.
and x and y are measured in pixels on the image.
That will give us how wide the object measures in each image in pixels, regardless of the orientation of the centerline, or the distance to the
To develop "theta", the object's angular width in degrees, it's a straightforward multiplication of pixels wide by the figure obtained above of
angular width per pixel (degrees per pixel) to reach a figure for the angular width of the object in degrees. In the multiplications, the pixel units
cancel and drop out, leaving a dimension in degrees. This is the "angular measure" of the object, and will vary for the same object according to the
distance to that object - farther away yields a smaller angular measure for the same object with the same actual dimensions.
To find how that angular measure, expressed as "theta" translates to an actual distance subtended by the angular dimensions at a give distance, we
then use a little more trig and the following formula:
d = D (sin (theta))
"d" is the "distance" or width the angle subtends at distance "D" away from the origin, which is the observer's position
"sin" is the trigonometric sine of the angle
and "theta" is the angle itself (in degrees in this case) which was determined above.
The formula states that we take the sine of the angle, and since sine is a unit measure of a unit circle, we multiply that figure by distance D, the
number of units between the observer and the object (15m to 152m in this case), and the number that results from that equation is the actual physical
size of that angle at that distance.
If anyone finds that confusing, you'll understand why I never went into teaching maths - I'm not good at explaining it without first going into basic
trig and the Unit Circle. The formula given of d = D (sin(theta)) is from calculating the z dimension of 3 dimensional x-y-z Cartesian co-ordinates,
and in this case the distance D is assumed rather than calculated from the x and y co-ordinates, obviating the need for those calculations. Minimum
and maximum constraints of 15m and 152m respectively are determined from the images, rather than calculated out, and simply plugged into the 3D
Cartesian equations to obtain minimum and maximum possible sizes for the angle theta at distances D1 and D2, which are the constraining distances. The
closer distance of 15m yields the minimum size possible for the object, and the farther distance of 152m gives the maximum possible size for the
object, using the same angular dimensions determined above.
Those distances were determined by direct measurement from the observer's position to the adjacent roof peak (minimum) and the communications tower
(maximum) on the satellite photos of the event area,
edit on 2012/4/13 by nenothtu because: (no reason given)