Tuesday, February 19, 2008

Part 2- DOF and Distance

If you haven't read my photography disclaimer, I recommend you read it now.

Photography with SLRs essentially involves navigating the multi-dimensional space created by many variables - aperture, shutter speed, ISO, exposure (ev), DOF, noise, focal length, focusing distance etc. In part, your effectiveness as a photographer depends on how well you understand this space and how well you can navigate it.

In this writeup I look at DOF. Before you read this article, I expect you already know what DOF is, and that you have some experience trying to control it. Browse around and a bit and read about DOF before you look at this article. Know what the terms mean and such. Here are two little articles that you introduce some terminology for you.

http://www.dofmaster.com/dofjs.html
http://www.dpreview.com/learn/?/key=depth_of_field

Here are some slightly more explanatory articles:

http://www.luminous-landscape.com/tutorials/understanding-series/dof.shtml 
http://www.cambridgeincolour.com/tutorials/depth-of-field.htm

Most books, like Bryan Peterson's popular "Understanding Exposure", give you a some perspective into DOF, how aperture affects DOF and how to use it creatively. I have always been a bit confused by depth of field because it never seemed to work quiet the way I expected. I always seemed to me that DOF relationships are not linear in the space of the variables that affect it. What I mean by that is that when I change a variable that affects DOF, say the aperture, it does not seem to change DOF at the same rate.

So what variables affect DOF? As best as I know they are not just aperture, but include aperture, focal length, focusing distance and camera type. Look at the URLs above, they have  DOF calculators there that accept values for these variables and give you various DOF values back. What we are going to do here is to plot some graphs between these to better visualize how one variable affects another. My graphs are based of the equations that run the DOF calculator on dpreview and are hence only as accurate as those equations are. What value you get out of this depends on how closely you look at the graphs and try to visualize what the curves mean in terms of actual photography.

 

This time we are going to look at the most frequently expressed relationship, that of DOF and Aperture.

The graph below shows DOF plotted against aperture for a focal length of 50mm and focusing distance of 1m (ie the object that you are focusing on is 1m away). This plot is for the Digital Rebel XT (the EOS 350d) and should hold for any 1.6x senor DSLR such as the Rebel, Rebel XTi and such.

image

The aperture has been varied from f/1 to f/32. Assuming we (ever) have an affordable lens at f/1. There are two lines in the picture. The lower one corresponds to the nearest point that will be in focus and the upper one corresponds to the farthest point that will be in focus. So at f/4, the region of focus starts at roughly 2.5cm in front of the point of focus and extends to about 2.5cm behind it. The total DOF at f/4 is about 5cm.

Since you are at the same position with respect to the object you are photographing and that focal length is 50mm throughout, changing the aperture will affect the depth of field and exposure time (the shutter speed) needed to maintain the same exposure value.

Notice how the graph tends to curve a bit? Lets see how the DOF curve looks when plotted at different distances. Here are the curves for some smaller distances all in the same graph.

image

For each focusing distance there are two lines, the lower one being the nearest point in focus and the farther one being the farthest point in focus. Some interesting things to note: 1) The DOF does not increase very much if you are focusing on close objects. 2) For short distances, of under a meter, the DOF seems to grow linearly.

Lets look at some greater distances.

image

Here the non linearities become very apparent. This graphs plots DOF curves at distances of 1 to 5 meters. Look at the y-axis, note that each unit corresponds to 2 meters. The pair of green lines representing the two meter focusing distance seems to increase almost linearly. At 3 meters, aperture values of 22 and above have rather large farthest points of focus.

The general trend is this: at greater focusing distances the father point of focus increases exponentially on increasing the aperture. In fact its worse than just exponential, the values hit infinity relatively quickly. So at focusing distance of 5m at f/22, the farthest point of focus has hit infinity.

Lets look at some greater distances.

image

At larger distances, smaller apertures lead to infinite DOF values. At 50m, f/4 already gives you infinite DOF! Even at 10m, there is a region of focus that is about 4-5m at f/4. Another way to look at this is that DOF tricks make sense only if the object in question is relatively close to you - i.e. within 2 or 3 meters. Well, that's not entirely true - we haven't heard what focal length has to say about it. But it does seem true at 50mm.

Here are some greater distances that show degenerate version of the above curves.

image 

Now lets go back to the first graph where we were at 1m and 50mm focal length. Lets look at some graphs that show the effect of changing the focal length. Along the x-axis we still vary the aperture value and on the y-axis we plot the DOF. We are just going to draw multiple graphs based on changing the focal length (while keeping the distance fixed).

image

So at wider apertures, the DOF increases. The effect of going from 50mm to 60mm, visually will also be that the object occupies a larger part of your frame. This is roughly what you get were you to stay at 50mm and step closer to the object. From this can we conclude that if the object stays roughly the same size in your screen, the DOF stays the same? I don't know yet. But the graphs seem to indicate so.

Let look at some wider focal lengths. The widest non-fisheye lens one can get for the Rebel series is the 10-22mm lens. (Its an awesome lens btw.) So lets start plotting at 10.

image

At 10mm f/5.6, we have already hit infinite DOF even when the object is just 1m away. At 18mm we hit infinity at about f/15. At 18mm and f/4 we have a decently small area of DOF, however remember how easily this degenerates based on your distance graphs? So if you want to take advantage of DOF when you are at the wide end, you must be pretty close to the object and have a wide open aperture (the smaller the numeric value of aperture, the larger is the actual aperture i.e. more light is allowed onto the sensor).

Lets look at some longer ranges.

image

Notice that the units of the y-axis have changed. At longer ranges (70mm to 120mm) the DOF stays small and concise, good enough to bring out that beautiful bokeh. Greater zooms have narrower DOFs - I don't bother to plot those graphs here. Its easy enough to imagine how they'd look.

 

So what do we have to take away. DOF does increase with aperture, but usually only for short distances. For greater distances there is non-linear increase in DOF often hitting infinity. Similarly at wider focal lengths you get a larger DOF for the same aperture. On increasing the focal length DOF does get narrower until some point where the DOF-aperture relationship starts to look linear again.

Distance from the object and the zoom (focal length) both DOF inversely. Increasing distance increases DOF and increasing zoom decreases it. In other words, if you were to step back but zoom in tighter to compensate, the increased distances and the increased zoom might compensate for each other giving you roughly the same DOF. (I would be able to assert this with some certainty if I have equations for the size of the image on the sensor.)

That said, if you want to take a picture whose beauty depends on DOF and you are willing to vary the object size in the final image (maybe you can compensate by cropping?), understanding the relationship between distance/zoom and DOF will come in handy. In the later parts of this write-up I hope to go into that. Let me know what you think.

Part 2 - DOF and Distance

Tuesday, February 19, 2008 9:44:57 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 

I am not a professional photographer. I am pursuing my PhD in theoretical Computer Science and I enjoy photography. Nearly all I what I have to say about photography comes with my experience with my EOS 350d that I have had for about 2 years, at the time of this writing. Hence take my opinions and suggestions with some discretion.

The art of "painting with light" has many ingredients. There are matters of spirit that each person brings - your aesthetics, your sense of beauty, your evaluation of what is worth shooting, etc. And then there are aspects of photography that involve understanding the nature of the machine and laws that govern it. To the latter part, I realized only recently, that I can apply my relatively abundant geekiness, potentially compensating part of my shortcomings in aesthetics. Hence my blog entries about photography.

Of course, some have more skill.

Tuesday, February 19, 2008 8:59:19 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Tuesday, February 12, 2008

Symmetry groups are beautiful and fascinating.

image

Cayley diagram for the Symmetry Group of a Cube, 

We can write some simple equations based on "following arrows" in the diagram. If red is "a" and blue is "b", we can say many things. "i" is the identity. If we take a sequence of arrows starting from a point and if the sequence of arrows lands us back at the starting point, then the path forms a closed loop and is equivalent to not having left the point at all.

a^4 = i
(ab)^3 = i
(abb)^2 = i
(aabb)^2 = i

Note that "a" and "b" are equivalent. They can be interchanged in the equations. Hence we may also conclude

b^4 = i
(ba)^3 = i
(baa)^2 = i
(bbaa)^2 = i

Similarly any "a" can be replaced by "-a", the reverse path, or any "b" by "-b". Also not that "aaa" is the same as "-a". Hence we can write:

aaa = -a

And hence,
(aaab)^3 = ((-a)b)^3 = i
(aaabb)^2 = ((-a)bb)^2 = i

Any sequence that forms a loop (equals i) can be started at any point (ie can be rotated) and it still forms a loop. Hence the following are equivalent.

(aba)^4 = i = aba.aba.aba.aba = aab.aab.aab.aab = (aab)^4.

hence we have,
(aab)^4 = i
(baa)^4 = i
(abba)^2 = i

Of course, I have missed some. You can fill them in with what you know now.

 

Now if we select "c" to be some string a and b, such that c^3 = 1, for example c = ab, we can draw a new cayley diagram from the resulting triangles and one of the squares (example a^4 = 1). The "c" arrows are drawn in green here.

image

This maybe visualized as a solid. A cube with each vertex replaced by a triangle and each edge having the width of the triangle's side. Now a very good diagram of the front view:

image 

 

The above group, corresponding to the diagrams, has a name - it is the symmetry group S4. It corresponds to the permutations of 4 character tuple, (A,B,C,D). How many permutations are there? There are 24. These can be though of as the 24 different points on the above diagram.

 

prev: Symmetry Group of a Tetrahedron

Tuesday, February 12, 2008 1:12:27 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Monday, February 11, 2008

I got my new baby this Friday. The Canon 24-105 L:

Friday was a busy day - meeting with Dybvig, Sabry and Michael Adams, followed by attending some of the Preparing Future Faculty conference talks, followed by a talk about "Exploiting Online Games" by Gary McGraw, followed by a talk about "A Theory of Hygienic Macros" by Dave Herman. I rush home after all of this to see the Amazon package at my door. Quickly unpack, eyes gleam, say "my preciousss..." for sometime and then quickly rush out for dinner with some of the PL folk.

Initial impressions - the lens is build like a tank. Its also fairly solidly built. Its thick and relatively short, with a filter diameter of 77mm it dwarfs the camera. In fact, one of the most solidly build lenses I have seen. Had it been not such a crime to the lens, it might even be used as weapon of self defense. "He was bludgeoned to death with a 24-105'. "Quid pro quo Clarice, you indeed do have a maniac on your hands".

This is also the first lens with which I feel I can manually focus with some reliability. The little viewfinder on the 350d is indeed limiting, but a good lens seems to make a lot of difference.

 

All that said, I have been able to play with it much. Bloomington has been real windy this weekend at -8 degrees Celsius. One can dress for the cold, but wind at that temperature is just too much. You hands freeze into numbness in no time. This makes me say "NOESS FAIR!" in lolcat style.

image

Despite this, I manage to take a short walk one day. The pictures below are uploaded full size as they came out of the camera without any sort of out of camera processing. The quality of the images is impressive, take a closer look.

IMG_0670

Sunset over the Dunn meadow, Bloomington, IN.

 

IMG_0633

East wing of Swain Hall, the building that houses the joint Computer Science, Math and Physics library.
Bloomington, IN

Monday, February 11, 2008 6:41:50 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Sunday, February 10, 2008

Kyle told me about this stuff and it seems so unbelievably cool.

http://graphics.stanford.edu/papers/lfcamera/

Like Kyle says, "probably the coolest invention in photography since film".

Also, http://scpv.csail.mit.edu/levoy.htm

The video they have linked on their website is worth watching after you have had a look at the web page.  This stuff is on youtube as well, linking it in here (though the quality of the direct avi file is arguably better):

I wonder how long it will be till we have this in cameras that we can afford to buy - 15 years?

Sunday, February 10, 2008 5:21:01 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Saturday, February 09, 2008

 

Saturday, February 09, 2008 9:23:59 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 

The other night over dinner with folk from the PL group I heard about "Lambda Cats". This is just hilarious.

dumb

Some are a quiet impossible to appreciate unless you know specific people in the PL community. Like this one. Or specific special problems. Like this one. The lambda cats website is inspired by the more general "I Can Has CheezBurger?". There you can even build your own :)

i-can-has-cheezburger

 

And of course, I had to do my own.

callcc 

After you have done one, it gets sort of addictive. I wonder if I can take pictures of my friend's pets (or kids) for the one true cause...

Saturday, February 09, 2008 5:09:45 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Friday, February 08, 2008

Today I was trying to draw the Cayley diagram for symmetry groups of a regular tetrahedron. (A tetrahedron is a like a pyramid, but with a triangular base.) What I ended up with, surprised me. I had started with the idea that I would end up with something that was tetrahedron like - or atleast suggestive of the fact that it started from a tetrahedron.

 Cayley diagram for a symmetry group of the tetrahedron.

Cayley diagram for a symmetry group of the tetrahedron.

Now, this is not the only group one can generate from a tetrahedron. And even for this group, this certainly not the only Cayley diagram as well. We can visualize the above diagram as a 3d object If I were to redraw this slightly, we get -

image

And now if I imagine this as 3d object, I get something looks like this.

image image

front and back respectively.

It is as if each triangle has triangle facing in the opposite direction behind it. And there are 4 such perspectives, each corresponding to a vertex of the tetrahedron. Cute. I wonder if I can make choices for a different set of rotations such that the triangles are not inverted? 

After some playing around with it, I got this. I realized that following any sequence of red-blue-red-blue arrows always leads back to the starting point. If I were to compose every pair of red-blue arrows into a single arrow, lets color this green, then we get a different diagram. This diagram is indeed suggestive of the shape of the tetrahedron. The same shape would result if we were to include the blue arrows instead of the red ones.

Cayley diagram for a symmetry group of the tetrahedron

Cayley diagram for a symmetry group of the tetrahedron

This shape is interesting because you can imagine that looks almost like a large green tetrahedron with the each tip sliced of to reveal a small red triangle. Here is a picture I found on the web:

truncated_tetrahedron_un[1]

This diagram also lets itself to a nice explanation - each triangle at a vertex corresponds to the sub-group for rotation about that vertex.

Friday, February 08, 2008 9:15:15 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |