Friday, December 25, 2009

Canon 7D Lens Adjustment

I was fortunate enough recently to be able to use some bonus funds to purchase a new camera. I have been using a Canon Digital Rebel (300D) since 2005. It still works great, but the 6-megapixel image size was a bit constraining, particularly when I wanted to crop in on an image that I framed one way when taking the picture, but decided would be better framed another way in post-processing. I dickered about quite a bit, but after encouragement from my Wife I finally went for the Canon 7D, semi-pro level camera.

When the camera arrived, I played around with it. At first, I was taken aback by what appeared to be focus issues. I realized that I was getting better focus manually than with the auto-focus. Then I remembered that more recent dSLRs permit one to tune the lens to the camera. I decided that this must be the issue I was facing, so what to do about it?

RawWorkflow.com has a product called LensAlign (http://www.lensalign.com/) which is designed for just this purpose. However, it was two days before Christmas, I wanted to use the new camera for gift opening and Christmas day shots and getting the product here in time was unreasonable. What could I do and do for cheap?

The LensAlign system is pretty straight-forward. There is a broad surface with high-contrast patterns on it that give the camera the greatest opportunity to focus at its finest. Oblique to that focusing plane is a "ruler" with distances marked. The zero point is exactly on the plane and the ruler makes about a 45 degree angle to the plane. The central idea is that the camera focuses on the plane, then you observe the ruler to find at what point the depth of field begins and at what point it ends. Tune the lens such that the depth of field surrounds the zero-point and you are good!

With time short, I went totally ghetto and jury-rigged a solution. A VHS tape case with a black and white illustration became the focusing target. I pressed into service a wooden yardstick to serve as the depth-of-field measure. Indirect light from a window illuminated the contraption, and I set to work. Using the tools at one distance (about 4 feet) I calibrated each of my four lenses. Final result, very nice! Much better auto-focusing, at least as good as my manual ability.

But, I was not satisfied that this was as well done as possible. I could think of a number of potential errors in the system:
  • Was the focusing target really of high-enough contrast?
  • Were the markings on the yard-stick of high-enough precision to accurately measure the depth-of-field?
  • I had adjusted the lens so that the depth-of-field range fell with the focus plane "in-between", but I had not made sure that it was in the location that is is supposed to be.


With a bit more work, I could address each of these. I needed a new focusing target, a new depth-of-field ruler and some information.

First, the focusing target. I broke out Google Sketchup 7 and pulled together a high-contrast checkered pattern to use for focusing. Beside that I drew a ruler with 1/8-inch graduations which are scaled 1.414-times oversize to account for the 45 degree tilt of the ruler. These I printed out and using a glue stick attached to a bit of cardboard scavenged from a packing box. I attached the ruler to the focusing plane by way of a long steel pin, making sure that the zero point on the ruler lined up with the surface of the plane.

That took care of getting a good target and measuring device, now to set to focus to exactly where it needs to be. The depth of field that a lens produces is a function of the focus distance, focal length, aperture and the sensor size. It is also not symmetric about the plane of focus, but rather has a smaller portion on the camera side of the the plane of focus and a larger portion on the background side. You can calculate the depth of field easily using a number of online tools, but the one I prefer is http://www.dofmaster.com/dofjs.html. Too narrow a depth-of-field and fine tuning would be difficult. To deep and it could exceed the length of the ruler. I decided to start with my Canon 50mm f/1.4. I decided that a depth of field of 3 inches would be good, for no good reasons beyond gut feel. The calculator told me that I would need to set the target 75 inches away from the camera to get a 2.99 inch depth of field. This seemed good enough for me. The calculator also told me that there would be 1/32 inch more depth-of-field behind the plane than in front. This was too small for me to worry about, so I planned on simply centering the field.

I attached the target to a light stand, put the camera on a tripod and aligned the two stands so that the center line of the lens fell perpendicular to the face of the target. I also made sure that the camera itself was level on the tripod. After each picture, I zoomed into the result image as close as possible and evaluated the level of focus at various points on the scale. Then I would adjust the lens adjustment some amount and take another shot. Repeat until the in-focus range falls equally on either side of the scale.

I readjusted three lenses, and the end result was that the three needed almost exactly the same amount. The 50mm f/1.4 and 100mm f/2.8 Macro both needed +13, the Tokina 17-50mm f/2.8 needed +12.

Christmas morning, everything was ready and the photos were acceptably sharp.

No comments: