 Helpful Posts:  0

# Thread: How to get the distance between lens and image plane for compact digital camera?

1. ## How to get the distance between lens and image plane for compact digital camera?

Hi all,

For image defocus, when we want to calculate the depth map, we use formula:
do = f * D / (D - f - 2*r*f_number)
f is focal length, f and f_number can be retrieved from EXIF infromation.
but How to get D (the distance between lens and image plane) ?

BS
Thanks!

2. ## Re: How to get the distance between lens and image plane for compact digital camera?

DEFINATELY one for Sean!

... But welcome to CiC anyway - great to have you with us!

3. ## Re: How to get the distance between lens and image plane for compact digital camera?

It looks like you're trying to use a formula to calculate front/rear depth of field. It appears to be that equation in a different form than I'm used to seeing. In that case, by "r" you are referring to the circle of confusion radius...? More clarification on exactly what you're trying to do (in words) would be helpful. Almost all equations have assumptions, such as low vs high magnification, so knowing the situation will tell us which equations will be most accurate...

Regardless, the (i) focal length, (ii) distance to subject from the lens and (iii) distance from the lens to the sensor are all related according to:

1/f = 1/d[lens to subject] + 1/d[lens to sensor]

Most cameras record both the focal length and the focusing distance (at least roughly). The focusing distance can be approximated as being equal to d[lens to subject] as long as you're not taking the photo at high magnification. You can therefore use these to calculate d[lens to sensor] as follows:

d[lens to sensor] = f * d[lens to subject] / ( d[lens to subject] - f )

Is this what you had in mind...?

compact cameras 