# [Digikam-devel] [Bug 151685] Show calculated/derived image paramters (depth of field, image angle, ...)

Christian Mayer bug at christianmayer.de
Sat Dec 1 15:36:46 GMT 2007

```------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

http://bugs.kde.org/show_bug.cgi?id=151685

> > Absolutly, we need formulas + context to use + full descriptions to add on API doc... else nothing will be done (:=)))

Here are some collected formulas for part one (more might come later...)

The information of this post comes from
understand German...).

Some definitions:

f:       the real focal length in mm (the number on the lens;
independent of the sensor size)
f_equiv: the felt focal length when used on a crop camera by comparing
the picture angle
Y:       the crop factor (Canon DSLRs have e.g. mostly 1.6)
s_[o,p]: size of the object (the thing infront of the camera) or the
picture (i.e. 1/2 of the sensor chip) in mm
d_[o,p]: distance of the object or the picture (i.e. sensor) to the
principal plane of the lens in mm
S:       the size of the sensor in mm (and thus S = 2*s_p) - depending
on the context it might be length, height or diameter
S = [36mm x 24mm] / Y
V:       reproduction scale, the ratio between picture size and object
size    V := s_o / s_p
a°:      picture angle (the real one, not the simplified one with the
object at infinity; changes with focus setting)
a°_inf:  picture angle when d_o = infinity (that's the one usually used
in advertising material of the manufacturer)

I'm assuming that the EXIF will tell me: f, d_o, S
to calculate the rest here are some formulas:

class optics (just for background; not needed):
1/f = 1/d_o + 1/d_p
s_o/d_o = s_p/d_p

interesting for the digiKam user (thus the results should be shown in
this whish):
Y = [36mm x 24mm] / S
V = f/(d_o-f)
a° = 2 * arctan( S*(d_o-f)/(2*f*d_o) )
a°_inf = 2 * arctan( S / (2*f) )

(note to the reader: this shows us that focal length at a croped camera
= crop_factor * real focal length is *only* correct when the lens is
focused at infinity! Thus:)

f_equiv = f*Y / (1 - f/d_o + f*Y/d_o)

V is important for macro photos (that have about a 1:1 ratio). It should
be displayed differently, depending on its value:
if( V < 1 )
printf( "%f : 1", 1/V );
else
printf( "1 : %f", V   );

> > We working on more important parts currently (Database improvements + XMP support + KDE4 port). So all help is very usefull.

I know. :)

```