27: Depth of field and the aperture

February 28th, 2010

The aperture is the main determinant of depth of field when using a camera. Open the aperture up and you will get less, close it down and you will get more. The question is: Why do you get more depth of field with a small aperture? To simplifiy things I will only be looking at the object side of the camera for this discussion. The same concepts apply on the object side as they do on the image side, so I will omit the image side for now.

Before we can get going, we need to define the circle of confusion in relation to the object side of the equation. We started by defining the circle of confusion in terms of the image. For a typical Nikon dSLR the circle of confusion is about 0.02 mm and the detector is about 23.6 mm wide. That translates into about 1/1200 of the width of the detector. To translate this to the object side you just need to know the width of your field of view and divide by 1200. This can also be written in terms of magnification as

c(o) = c/m           (where c(o) = object side circle of confusion, c = circle of confusion, m = magnification)

As magnification goes down (i.e. the field of view enlarges) the c(o) proportionally enlarges. As the magnification increases the c(o) proportionally decreases.

As the aperture closes the DOF enlarges

Now we can get about discussing the role of the aperture in DOF. The top part of the diagram shows a large aperture with a relatively narrow depth of field. The object circle of confusion is located at the focus plane and listed as c(o).  The bottom diagram shows the effect of closing the aperture. c(o) remains the same, but the angle of the rays extending from the lens to c(o) has decreased and this causes the depth of field to increase. At a narrow angle, it takes longer for the blur circle to enlarge to the size of the c(o) and thus the DOF is increased.

You will also notice that the increase is mostly on the far side of the focus plane. Because of the angles involved, there will always be more depth of field on the far side of the focus plane compared to the near side. As the field of view gets larger (lower magnification), that difference will increase. Typical photographers say that 1/3 of the DOF is in front of the focus plane and 2/3 is behind the focus plane. This is more of a rule of thumb than a fact as the actual distribution varies quite widely.
As the magnification rises into the macro photography range, the distribution of DOF becomes more equal on the far and near side of the focus plane. The distribution always favors the far side, but the difference becomes minimal at high magnification. Beacuse of this it is commonly assumed the the distribution is equal far to near with macro photography.
Next: Why is there so little DOF at high magnification?

26: Depth of Field – The basics, graphically

February 25th, 2010

I find that I can read a printed explantion and not be able to get a strong understanding of the concept. I need to see a graphical representation of the concept to really get a feel for it. Depth of field is much easier for me to understand with a nice diagram.

basic depth of field diagram

 The diagram above shows the basics of depth of field. An object at point y is at the focus plane and will be in sharp focus at the detector. An object at point x is behind the focus plane and will focus in front of the detector. The light rays from x won’t just stop at their focus point, they will continue on to the detector where they will form a blurred circle the diamter of c. The opposite will happen to an object at point z. since it will come into focus behind the detector it will also form a blurred circle the diameter of c.

If we define c as the amount of blur your eye tolerates in an image, c is the Circle of Confusion. The distance between oject x and object z is now the Depth of Field (DOF). An important point to remember is that not everything within the DOF is equally sharp. The object at the focus plane is sharpest and objects will get progressively fuzzier as you move either forward or backward. The fuzziness increases until it becomes visible at the limits of the DOF. Another point to remeber is the DOF is only valid under a certain image viewing size and distance. If I were to get up close and personal with the image (zoomed up to full size on a computer screen), objects the were sharp previously may now become fuzzy as I have now changed the image magnification and thus changed the CoC.

Next: How the aperture makes the DOF larger or smaller.

25: Depth of Field – The background

February 9th, 2010

Depth of field is aconcept based on the fact that your eyes will tolerate a certain amount of image unsharpness before the image appears “fuzzy.” That is, the object in the picture doesn’t have to be in perfect focus to still appear sharp. For a perfect lens, at the focus plane, the image is prefectly sharp. As you move forward or backward from the focus plane the resulting image will slowly get less sharp. The distance between the point in the front of the focus plane where the image starts to appear fuzzy to the same point on the back side of the focus plane is the depth of field.

The question is: At what point does the image become fuzzy? Well, that turns out to be a rather subjective quantity.  To find out the amount of fuzziness that a typical person can tolerate, we need to know how small of a detail can a person see on a typical photograph. Again, this number will depend upon the size of the image, the viewing distance and viewing conditions. Thankfully, those conditions have been standardized. Most people assume that a person is viewing an image about the size of an 8″ x 10″ from 25 cm away. In that situation, the smallest size detail that a person with good vision can see is about 0.2 mm. Anything on the image that is 0.2 mm or smaller will be considered “sharp.” If I were to change the viewing distance or image size, the numbers will change and thus the depth of field will change.

Remember that the 0.2 mm size is on a printed8 x 10 image. That image is likely an enlargement of the original negative or detector size. The 0.2 mm will be proportionally smaller on the negative or detector. That size turns out to be about 0.03 mm on a 35 mm negative. This number is termed the Circle of Cunfusion. Most digital cameras have detectors that are smaller than a 35 mm film frame so the circle of confusion (CoC) will be proportionally smaller as the image from the detector will need to be enlarged more to get to 8 x 10 size. Digital SLR’s commonly have a CoC of 0.02 mm (APS-C detector size) and most point and shoot cameras have a CoC that is considerably smaller yet (~0.005 mm).

How this number translates into real life images will be discussed in the next entry.

24: Numerical Aperture, the association of front to rear

February 7th, 2010

As with the front of the lens, the effective aperture can be easily converted into a numerical aperture (NA). 

NA_rear = 1/(2*N*((m/P) + 1))                  (where N = f-number of lens, m = magnification, P = pupillary magnification)

Computing a working NA for the rear of the lens isn’t particularly helpful for me as I prefer to use effective aperture. The interesting part is that the working NA for the front and the rear of the lens are tied together mathamatically.

NA_front = NA_rear*m

It’s a very simple association and it is completely independent of pupillary magnification. That means that with any lens of whatever pupillary magnification and f/number, any gains or losses in NA on the back of the lens associated with the pupillary magnification will have an proportional gain or loss in the  NA on the front of the lens. 

This association can also be tranferred  into terms of f/numbers where it is probably more useful to most photographers (microscopists work predominantly in NA terms).

Working f_num = Effective_aperture/m

As an example, if I have a lens set to f/4 with a P=1 and an m=5, the effective aperture is 4*(5+1) or f/24. Applying the above equation gives you a working f/number of  24/5 or f/4.8. That translates into a NA of  1/(2*4.8) or about 0.10. 

Another example is with microscope objectives. The NA listed on the objective is a working NA at the listed magnification. A 4x/0.10 objective has a working f/number at m=4 of  1/(2*0.1) or f/5. The effective aperture is (5*4) or f/20.

23: The working numerical aperture.

February 6th, 2010

In the previous entry we discussed the numerical aperture (NA) in similar terms to the f-number, referring the calculation to the front focal point. Measured at the front focal point, the resulting NA is the maximum possible for the lens. Imaging at the front focal point implies an infinite magnification and infinite image distance – not possible with any camera that I know.

That leaves us with calculating an effective or working NA – the numerical aperture that the entrance pupil forms with the object being photographed. Like the effective aperture on the image side, the working NA is determined by f/#, magnification, and pupillary magnification. The equation is very similar to the equation from the previous entry but with an added multiplier that takes into account the magnification and the pupillary magnification.

NA = 1/(2*N*((1/m)+(1/P)))                       (where N=aperture setting, m=magnification, P=pupillary magnification)

The above examples are all f/4 so the entrance pupils will be the same size. The P=2 has the largest Eff-NA and P=1/2 has the smallest

You will notice that the f/4 P=2 lens has an Effective NA advantage on the front end just as it does on the back end of the lens with the Effective aperture. The same applies with the disadvantage with the f/4 P=1/2 lens. It turns out that there is an association between the NA on the front of the lens and the NA on the rear of the lens. That will addressed in the next installment.

22: The numerical aperture.

January 10th, 2010

The numerical aperture is the same concept as f/number but on the front of the lens. Whereas the f/number determines the image resolution, the numerical aperture determines the object resolution. Numerical aperture is the angle that the aperture makes with the front focal point.

The basic form of numerical aperture is determined by two measurements – the size of the aperture and the distance that the aperture is from the front focal point of the lens. A larger aperture that is closer to the focal point will have a larger numerical aperture (NA) and will result in higher potential object resolution. The NA is closely associated with the f/number of the lens.

NA = 1/(2*f-num)                   (where f-num = focal length/entrance pupil diameter)

and vice-versa:   f-num = 1/(2*NA)

Technically, the numerical aperture is the sine of the half angle that the aperture makes with the front focal point. I have seen various sources suggest that for small NA’s the tangent of the angle is a close approximation of the sine. While that assertion is true, it is superfluous. Why use an approximate tangent when the sine is correct? Maybe somebody can enlighten me. 

At first glance, it would appear that the NA is equal to the tangent of the angle as the NA is equal to half of the entrance pupil diameter divided by the distance from the entrance pupil to the focal point. The first time I looked at a typical diagram, I thought the same: Why sine and not tangent?

The usual way of diagramming the numerical aperture

The answer lies in the fact that the entrance pupil of a well-corrected photographic lens is not just a circle, it is a section from a sphere with a diameter f (focal length) centered at the focal point of the lens (based on a quote from Rudolph Kingslake – a well respected optical engineer so I’ll go with that).

That means that the hypoteneuse of my triangle is equal to the focal length. The vertical line down to the baseline of the triangle from the edge of the entrance pupil (En/2 in length). That means that the NA represents the sine of the angle and not the tangent.

The actual configuration of the numerical aperture

NA = sin(angle a) = (En/2)/focal length          (where En is the entrance pupil diameter)

Like f-number and effective aperture on the backside of the lens, there is NA and effective NA on the front. It is likewise affected by the magnification and the pupillary magnification. We will go into that concept in the next posting.

21: Why aren’t all macro lenses designed with a P>1

December 27th, 2009

Having a pupillary magnfication greater than one does provide a potential advantage in resolution at the detector compared to symmetric and telephoto lenses. So, why aren’t all lenses designed this way? It turns out that there are lots of reasons that lenses aren’t or can’t be designed this way.

As you will recall, having a P>1 means that the lens is retrofocus. With most SLR’s this design is necessary with shorter focal length lenses in order to allow infinite focus. The necessary displacement of the principal planes toward the detector characteristic of retrofocus lenses will cause you to have to give up some working distance. This is because the front principal plane also tends to be displaced toward the back of the lens with a retrofocus design. Since object distance is measured from the front principal plane, you will have more lens in front of it and thus less working distance. With non-macro work, this displacement makes little if any difference in the use of the lens. With macro imaging you may find that the object you are trying to photograph is running into the front element of the lens at a relatively low magnification. A good working distance is a highly prized feature for a macro lens.

A telephoto lens design (P<1) is just the opposite. These lenses tend to have extra working distance, but do pay a small penalty in resolution capabilities. Symmetric or nearly symmetric lenses are a good compromise between these competing factors. You may not get the same resolution capabilities inherent to a retrofocus design, but you will retain a reasonable working distance.

I honestly don’t know how all of these issues factor into lens design. I would guess that with a typical SLR lens is designed either retrofocus or telephoto out of necessity. The differences in resolution and working distance mean very little at non-macro focus distances. At high magnification, these factors become much more important and have to be considered in the design process. The question is: do you want working distance or improved resolution?

A small point to end this entry. The resolution difference between lenses of various pupillary magnification is really pretty small. The improvement can be easily shown mathematically, but in the real world the difference is generally minor. That’s why many choose to ignore this factor.

20: Effective aperture and the exit pupil.

December 16th, 2009

We have previously discussed the concept of effective aperture and have found that it is related to the size of the aperture and the distance the aperture is from the detector. A small aperture that is close to the detector is equivalent to a larger aperture farther away – i.e. as long as they make the same angle with the detector they will have the same effective aperture.

We have been talking about the “aperture” previously for this discussion, but the real work of the effective aperture is done at the exit pupil. As previously defined, the exit pupil the apparent size and position of the aperture as seen through the lens. This all means that the pupillary magnification have an effect on the effective aperture, although predominantly with close-up and high magnification.

To set the stage for this discussion, you need to know how the pupil moves in relation to the rear principal plane as the pupillary magnification is changed. With a symmetric lens (P=1), the entrance and the exit pupils are equal in size. So, a 100mm f/4 lens will have a 25mm entrance pupil and a 25mm exit pupil. In this case the entrance and the exit pupils will be positioned at the principal planes. The effective aperture at infinite focus will be focal length divided by the exit pupil – 100/25 or f/4. 

For non-symmetric lenses (P<>1) with the same f/number, the exit pupil will travel along this same cone forward or backward depending upon the pupillary magnification, its size and position proportional to the pupillary magnification. This concept is easier to see in a diagram. A point that took me a while to figure out is that the diameter of the cone as it crosses the rear principal plane will always be the same same size as the entrance pupil, no matter what the pupillary magnification is.

The size and position of the exit pupil in relation to the rear principal plane is proportional to the pupillary magnification

The size and position of the exit pupil in relation to the rear principal plane is proportional to the pupillary magnification

At infinity focus (focus at the rear focal point of the lens), the effective aperture is always the same as the aperture setting. The exit pupil may be only half the distance from the focal point with a P=1/2 lens, but the size is also halved and the angle it makes with the detector is unchanged. At any focus closer than infinity, the front aperture setting and the effective aperture will start to diverge as you would expect with the effective aperture. The difference is that the resulting effective aperture will vary depending upon the pupillary magnification. Again, this is best seen with a diagram.

The same apertures as above for a 100mm f/4 lens. Effective apertures at 1:1 magnification in blue

The same apertures as above for a 100mm f/4 lens. Effective apertures at 1:1 magnification in blue

The formula that defines this relationship of the effective aperture to the pupillary magnification is:

N’ = N*((m/P) + 1)                        (where N’ = effective aperture, N = lens aperture setting, m = magnification, and P = pupillary magnification)

The long and the short of it is that with a P>1 you will lose less aperture as the magnification is increased and the opposite for a P<1. A larger effective aperture (smaller number) means more potential image resolution. Sounds like all high magnification lenses should have a P>1 – well maybe not as we will discuss the plusses and minuses of this situation in the next installment.

19: The Aperture and Resolution

December 5th, 2009

The aperture is the main determinant of potential lens resolution. I use potential because the imperfections in lens design and manufacture will also strongly affect the actual resolution of the lens. So, assuming a perfect lens, the aperture is the main determinant of resolution in most imaging situations.

The relative size of the aperture in relation to the detector determines the size of the Airy disc. This encompasses two quantities: 1) The size of the aperture and  2) The distance that the aperture is from the detector. A large aperture that is close to the detector will produce the highest potential resolution.

The easiest way for me to think about the relative size of the aperture is in terms of the angle that the aperture makes with the detector. A large aperture that is close to the detector will allow light from a larger number of incident angles to hit the detector. That same aperture farther away will lessen that variety of angles.

The angle that the aperture makes with the detector determines the amount of diffraction. A large angle will produce less diffraction and a small angle will produce more. More diffraction means a larger Airy disc.

the realtive size of the aperture can be expressed as the effective aperture. The aperture setting on a lens is only applicable to infinity focus. That means an f/8 aperture focusing at the focal length of the lens. Two f/8 lenses will have the same amount of diffraction at inifnity focus regardless of the focal length since the calculation of f/number already compensates for different distance from the aperture to the detector.

As the lens is focused closer than infinity, the aperture will move away from the detector. This increased distance will lessen the angle that the aperture makes with the detector and will thus increase the diffraction and the size of the Airy disc. The distance that the aperture is from the detector will be m+1.

Effective aperture: angle a is the largest and c the smallest (most diffraction)

Effective aperture: angle "a" is the largest and "c" the smallest (most diffraction)

The relative size of the aperture can be expressed as the effective aperture. The effective aperture can be expressed as :

N’ = N*(m+1)              (where N’ is the effective aperture, N is the actual aperture setting, m is the magnification)

An f/8 lens will have an effective aperture of f/16 when working at 1:1 magnification. The effective aperture is the most important determinant of diffraction and thus the resolution that the lens is producing at the detector. That means that as the magnification increases, the effective aperture also increases. An effective aperture of f/16 at 1:1 will produce the same amount of diffraction as a real aperture of f/16 at infinity focus.

The astute out there might say ” Hey, since the effective aperture increases as the magnification increases I shouldn’t get any more resolution out of a lens as I increase the magnification.” This is where the (m+1) factor comes into play. At low magnification the “+1″ makes a larger difference in the effective aperture than it does at high magnification.

As an example: If I am working at 1:1 and f/8, my EA (effective aperture) is 16. At 2:1 my effective aperture 24. The magnification has doubled, but my effective aperture has only risen by 50%. that means that I will get more detail out of the image at 2:1 than 1:1. This effect lessens as the magnification rises and eventually you won’t get signficant increased resolution out of a lens by increasing the magnification and is commonly called “empty magnification.”

As the magnification rises, the only effective way to get increased image resolution is to make the aperture larger, thus decreasing the effective aperture. That means opening up the aperture. The problem lies in the fact that the lens aberrations will increase as the aperture is opened and will tend to negate any improvement and even worsen the image beyond a certain aperture setting.

This trade-off between aperture size (diffraction) and aberrations means that a lens will have a sweet spot for resolution and have a sharpest aperture. Most commercial lenses will be sharpest in the f/5.6 to f/8 range. Lenses with larger sharpest apertures tend to be specialty macro lenses (shorter focal length bellows lenses) and microscope objectives.

Next: It’s not really the aperture, it’s the exit pupil.

18: The Airy disc and resolution

November 21st, 2009

The Airy disc as described in the previous entry is the smallest point of light that can be focused by a lens at a particular aperture and represents a diffraction pattern. The size of the disc is a direct determinant of image resolution.

The resolution of a lens is defined as the closest that two objects can be to each other while still being separately resolved by the lens. The two objects in question are two Airy discs. As the two discs get closer and closer together they will start to merge and at a certain point the separation between them will be lost. 

The top two are fully separated, the middle are barely separated and near the resolution limit, the bottom two are not resolved

The top two are fully separated, the middle are barely separated and near the resolution limit, the bottom two are not resolved

The distance between two Airy discs where they are still considered to be resolved separately is the radius of the disc – also called the Raleigh criterion. A smaller Airy disc means a smaller disc radius and a higher resolution. This distance is somewhat arbitrary as there is still a small amount of contrast remaining in the space between the discs at the Raleigh criterion. If the discs are moved any closer, the remaining contrast between the two objects will completely disappear. The point where all contrast is lost between the adjacent discs is called the Sparrow criterion and is the absolute limit of resolution.

The Raleigh criterior is the most commonly used measure of resolution:

Airy disc radius = 1.22 * N * light wavelength ( N = aperture size, light wavelength is commonly 546 or 550 nm or 0.550 um, a wavelength of green)

The Airy disc diamter is just double the radius.

The Sparrow criterion is expressed as:

D = 0.947 * N * light wavelength (about 80% of the Raleigh criterion)