by John Reilly (neuroanatomist)
Autofocus microadjustment (AFMA) is a procedure that allows a user to correct for small errors of front- or back-focusing. It is a feature that is present only on certain models of Canon dSLRs (currently, the 50D, 7D, 5D Mark II, 1D Mark III, 1D Mark IV, 1Ds Mark III, and 1D X). AFMA will have the greatest benefit for lenses with fast apertures (f/2.8 and wider), because the thin depth of field at wide apertures makes even small focus errors more evident.
This tip comprises two main sections, a practical summary of the procedure for those who want to dive right in, followed by more technical discussion, including some DIY options for a testing setup.
The easiest way to perform an AFMA is with a commercial tool, such as the LensAlign MkII or the DataColor SpyderLensCal (see the discussion below for an explanation of common failings of printable test charts and moiré patterns, and a reasonable workaround). Set up the tool on a table or ideally a small tripod, and set your camera up on a stable tripod. The distance between the calibration tool and the camera should be approximately 25 times the focal length of the lens (e.g. 85mm x 25 = 2.1 m = 7 feet), although anywhere within 5-50x focal length will work. Note that the distance of 25x focal length is independent of sensor size – 7 feet would be appropriate for an 85mm lens on APS-C, APS-H, or FF. If you are adjusting a zoom lens, base the distance on the longest focal length, and perform the calibration at that longest focal length (note that the new 1D X allows you to calibrate a zoom lens with two separate adjustment values, for the long and wide ends). For long lenses, you need a fair amount of space.
Aim the camera so the center AF point is centered on the focus target, and align the camera so the sensor plane is parallel to the focus target (using the sight gates in the LensAlign, or by ensuring both are level for the SpyderLensCal).
Lighting is important - ideally, bright constant lighting for both the focus target and the ruler, with lighting for the latter angled to avoid reflection. I suggest using a pair of desk lamps, one lighting the ruler from high angle, the other lighting the focus target. I actually use three lamps, each 150 W-equivalent. Here's what my typical setup looks like:
If convenient, set up to shoot tethered (you’ll need to review images at 100%). Set the camera in Av mode, maximum aperture, and for this purpose it’s best to shoot in JPG with the Picture Style set to Monochrome (if you shoot in color with a lens like the 50L or 85L, be prepared to see a lot of longitudinal CA!). Use a remote release or self-timer, and the mirror lockup function. Access the C.Fn setting for AF Microadjustment (in the Autofocus/Drive section), and choose 2: Adjust by lens.
At this point, there are multiple ways to take your test shots. You can iteratively bracket – shoot at -20, -10, 0, +10, and +20 and see which pair of settings bracket correct focus on the zero-point of the ruler, then narrow it further. Or, you can shoot at every setting from -20 to +20. The important point is to take several shots at each AFMA setting, not just one or two – particularly in the region where your adjustment ends up, and to take at least some shots starting from infinity focus and some starting from the minimum focus distance (MFD).
Here’s my strategy: take one shot at zero and check for front or back focus (e.g. if the focal plane is in front of the zero point on the ruler, that’s front focus). Front focus requires positive adjustment to correct, back focus requires negative adjustment. I shoot single shots starting from infinity focus and review at maximum zoom on the rear LCD, in increments of 5 units then narrowing further, until I have a tentative AFMA setting for that lens. Then I shoot at a total of 11 AFMA settings – 5 units on either side of my preliminary choice. At each setting, I shoot eight shots, two starting from infinity, then two without refocusing, then two starting from the MFD, then two more without refocusing. I then transfer the images to my computer, and review them at 100%. DPP will show the AFMA setting as part of the EXIF data (or you can stick a post-it note to the target with the current setting). Ignore any obviously out of focus shots, where no part of the ruler is clear. I generally find that as I step through the images, when approaching the best adjustment, the shots from infinity will be off, then at the best adjustment they’ll all be spot on, then as I move away the shots from the MFD will be off, or vice versa. For me, the whole process takes about 30 minutes per lens+camera combination. I often find that 3-4 adjustment values look 'ok' (e.g. +1 to +3, so I just use the average); usually, a wider aperture lens with thinner DoF gives a tighter range.
Some other important tidbits: the camera will store up to 20 lens-specific adjustments; adjustments are by lens type, so if you have more than one copy of a lens, the camera can’t tell them apart (although the 1D X can tell them apart based on lens serial number); a lens plus extender counts as an additional lens (and must be calibrated separately from the bare lens).
That’s the short version…read on for more detail and theory, or if you prefer, skip to the very end for a DIY suggestion to substitute for a commercial calibration tool.
Why is AF microadjustment important?
Cameras and lenses are manufactured on assembly lines, and tolerances apply to any manufacturing process – a desired specification and a range of acceptable values around that. If you’re lucky, you get a camera and lens that are both spot on, or are ‘off’ by the same amount in the same direction, and life is good. If you have multiple lenses and/or bodies, chances are one or more will need some adjustment. The other factor is depth of field (DoF) – the wider the aperture, the shallower the DoF. With relatively narrower apertures, such as the f/3.5-5.6 range commonly found on consumer zoom lenses, the DoF is deep enough to mask minor focus errors, so AFMA is not as important in those cases. But with fast lenses which achieve shallow DoF, even small focus errors are very evident. Prior to the availability of AFMA, the only option to correct these issues was to send camera(s) and lens(es) into Canon – and you had to send your entire kit to them. The need of pro photographers to have that done was part of the reason Canon launched Canon Professional Services.
What is AF microadjustment?
AFMA corrects for bias in the AF system, or put another way, it improves the global accuracy of the AF system. The terms accuracy and precision are sometimes (improperly) used interchangeably - accuracy is 'closeness to true' whereas precision is repeatability. Here's a diagrammatic example:
AFMA corrects for accuracy but does nothing for precision. In effect, it moves the center point - the 'average' focal plane of multiple measurements. But it's important to remember that precision plays a role, so if you test your AF system with just one or a couple of tries, random chance says your test won't be 'spot on' due to imprecision. So, when testing AF performance, you need to perform multiple tests for a given lens, and fewer tests would be needed for an f/2.8 or faster lens due to the higher precision AF point activated by such a lens. I suspect this is what's behind Canon's statement that AFMA can prevent correct focusing - if you base an adjustment on one or two test shots, and those shots were relatively far off the correct focal plane, then on average most of your subsequent shots will miss focus.
It’s worth noting that even though we test and set AFMA based on depth of field, what is actually affected is depth of focus. This makes sense, in that the AF system cannot control what’s in front of the lens, but can control what’s going on behind the lens. Depth of focus refers to the region of critical focus surrounding the sensor, and that region is a fraction of a millimeter thick. Canon specifies the precision of the AF system to be within one depth of focus for a lens’ maximum aperture for standard-precision AF points, and within 1/3 of the depth of focus for a lens’ maximum aperture for high-precision AF points which are activated by faster lenses (f/2.8 center point on most bodies, f/4 center point on 1-series bodies). One unit of AFMA equates to 1/8 of the depth of focus of a given lens’ maximum aperture.
No camera will produce a perfectly focused image every time at every distance, and no adjustment procedure will change that. What a proper AFMA can do is increase the percentage of shots that are correctly focused.
Is there an even better way?
If the procedure seems like a lot of work, it is! Yes, there almost certainly are better ways. In a post on the Canon Rumors forum, user epsiloneri described a method of analyzing the contrast of a focus target (standard deviation of pixel intensities) and plotting the data with a parabolic curve fit to determine the best AFMA setting. This looks like a very accurate method, although probably far too tedious without a way to automate the analysis (e.g. MATLAB or ImageJ).
In theory, it should be possible to achieve an ‘accurate’ focus using contrast detection in Live View, where no alignment is needed because the image sensor is used to determine best focus, then compare that to the phase detection AF and correct accordingly. In practice, this is something that’s difficult to do (because the act of moving the focus ring to see if you were really optimally focused changes the focus, and you lose the ‘zero point’). However, this is an idea that Canon could implement as a semi-automated routine, i.e. set up and align target (Canon could sell one, and suitably overcharge for it as they do for other small pieces of plastic *cough*), then the camera automatically determines the optimal adjustment. File that one under ‘gee, wouldn’t it be nice…’
If it’s done right, will it be perfect?
No, the AF system will never be perfect. There are a couple of big reasons for that. The first is that any system suffers from randomness – all an accurate AFMA does is maximize the frequency of in focus shots you get, but there will still be some misses. The other reason is that the focus target is an ideal situation – flat with high contrast. The world is not composed of focus targets - if it was, photography would be pretty boring. The complexity of real world scenes is further compounded by our expectations. You aim your camera and carefully place the AF point on the feature of your subject you want to focus on. However, the AF system can’t read your mind – all it can do is lock onto the region of highest phase difference within the area of the AF point. Note that the actual AF point is larger than the little box that represents the point in the viewfinder. Even with the Spot AF feature on certain cameras (7D, 1D Mark IV, and 1D X), which reduces the effective size of the AF point, the actual sensitive area is equal to or slightly larger than the representation in the viewfinder. So, with certain subjects, especially at acute angles to the camera with a thin DoF, the AF point may lock onto one of two different features yielding noticeably different focal planes. Both would be ‘correct’ as far as the AF system is concerned.
Free testing methods – what’s wrong with them?
There are a couple approaches to performing AFMA without one of the commercial tools. One involves setting up a moiré inducing pattern on a computer monitor, and evaluating focus based on Live View on the camera’s rear LCD. That’s a pretty easy method, but it has two problems. First, it’s difficult to align the setup so the sensor is parallel to the LCD screen. Second, I have found that there is a lot of imprecision in the method – when viewing a moiré pattern at 10x Live View, the camera can be moved back and forth quite a bit without seeing a noticeable change in the pattern on the rear LCD.
The other free approach involves a chart that you download and print out, then position at a 45° angle to your camera, focus on a dark line and use the scales on the sides to check focus. The problem with this is that the focus target (line) and the DoF scale are in the same 45° plane, so the target is not orthogonal to the sensor. Actually, what is probably the most popularly-used version of that chart had an older version (still available) where you printed two pages, then cut one up like those old tab A slot B toys cut out of a cereal box, and taped to the other page. The creator stopped that approach due to the variability of assembly leading to variable results. The current version uses a dark horizontal line as the focus target, with the rationale that because the line is horizontal, it doesn’t matter to the AF system that the page is at an angle, it still shows up as a 2D horizontal line. That’s true – but then it is only going to optimally activate the horizontal line-sensitive part of the AF point. On many cameras, that’s not going to work well. Current xxD and the 7D's f/2.8 sensor are a pair of diagonal lines, meaning a thin black-on-white line oriented horizontally is not going to activate that sensor. For the Rebel/xxxD line and the 5D/5DII, the f/2.8 sensor is a vertical line-sensitive sensor that ignores the horizontal line on the chart. So, that horizontal line is only going to activate the f/5.6 horizontal line-sensitive part of the cross-type sensor in the center AF point. You may be wondering - why did the guy make the chart like that? I would guess it's because he designed it to test AF on Nikon cameras, which don't have the high-precision AF point capability - their cross-type sensors are f/5.6-sensitive in both orientations, so a horizontal line target should be just fine.
The better DIY approach
If you’d rather not purchase a commercial tool for AFMA, my advice would be to recreate the important features of those tools with inexpensive substitutes. Here’s what I’d recommend. It would require a cardboard box, a book, a tape measure, a chopstick or pencil, and a printout of this focus target (thanks to Bob Williams for the link). It could be set up on a table, or even the floor if necessary. If you have a good tripod, you would use that instead setting the camera on a book. The focus target gets taped to the box, down low, and chopstick/pencil gets stuck in at the edge of the box, vertically centered on the target. The chopstick supports the tape measure at an angle. Note the measurement on the tape measure where it passes next to the target - that's your 'zero point' against which you can judge front or back focusing (when you review your images at 100% on your computer). Pick a book of a thickness that centers the lens at approximately the same height as the center of the focus target.
The setup would look something like this:
I hope this clarifies some of the pitfalls in AF systems and the advantages of and procedures for achieving a useful AFMA. Happy (and Sharp) Shooting!
Another lens focus calibration technique that is getting some attention is called "DotTune". The DotTune process involves using LiveView to accurately focus the camera. With the lens set to MF, AF MicroAdjustments are made to determine the range that cause the viewfinder in-focus indicator to illuminate. With the range known, the mid-point in that range is determined to be the proper AFMA setting for that lens and camera.