- Ed Dozier
Extreme Accuracy Focus Fine-Tune Calibration
If you take lens focus calibration seriously, then you might want to consider changing from mere visual inspection to doing it by the numbers. Computer analysis is far more discriminating than what people can accomplish via judging sharp focus by eye.
Let your computer help you calibrate your focus
Some newer cameras can focus-fine-tune using built-in features, but the results aren’t quite as precise as they can be. Estimating focus by using “slanted ruler” targets (or picket fences) will only typically get you within about 10 or 15% of optimal.
I think it’s about time to describe in painstaking detail a method to get the best focus calibration possible. In many previous articles I mentioned the benefits of focus calibration, but I never went into much detail about the procedures to actually do it. I hope that this article will rectify that situation.
I’m going to show you a technique that is incredibly accurate, but it will require a little bit more effort on your part. This procedure involves using the free software called MTFmapper. The same web site that offers this software also provides various focus target files (and resolution charts, too).
Some cameras only let you choose a single focal length or focus distance for calibration; for these, you should pick your most-used lens settings for measurements.
The Focus Target
You need an excellent focus target of appropriate size to get the best results. If you have to get really close to a focus target, yet you always shoot subjects from much farther away, the results are sub-optimal.
The focus target (from the MTFMapper site)
The image above shows you what the target looks like after you have rotated it by 45 degrees, with the left-hand side farther away than the right-hand side. The bands of little squares appear to be constrained into the shape of a rectangle, but this is an optical illusion. They’re actually constrained into the shape of a trapezoid, where the left side is taller than the right side. The lens perspective distortion makes the trapezoid appear to be a rectangle (or nearly so).
The red square shown above represents where you point your camera’s focus sensor. It needs to be over the large right-hand side edge of the big “target” rectangle. This makes for an easy, unambiguous focus target for your camera. There’s no doubt where your camera is trying to focus.
Focus chart for shooting close
The focus chart above is called “perspective_a0_distance_1500.pdf”. This chart would ideally be printed on “a0” size paper shot from 1500mm away. It’s an example of the many charts the MTFMapper site offers.
Different lenses (e.g. telephoto, normal, wide-angle) can have vastly different perspective distortion. Because of this, the MTFMapper web site offers multiple target files that have different levels of distortion. You need to pick the target that most nearly matches the lens/distance being tested. If you shoot a target that has large perspective distortion trapezoids with a telephoto, some program analysis features will probably fail. The rotated targets in your viewfinder should look like rectangles when you properly match the target to the lens and focus distance.
I sometimes grossly violate the recommended shooting distances/charts for focus testing (see below). Some software analysis features may be unavailable or limited if you do this. I make these violations to get more precise information about where the lens is focusing.
You should print and mount the target(s) onto something like poster board or wood. I have different sizes of printed targets, depending on the lens being tested. I use spray-on adhesive to mount the paper target completely flat. Dry-mounting services at art stores work extremely well for mounting larger-sized prints.
I make target prints out of both Laserjet and Inkjet. If you’re shooting in infrared, only Laserjet will work; inkjet inks are generally invisible to infrared.
I have a range of printed focus targets from as small as 8 ½ by 11 inches to as large as 4 feet by 5 feet. This gives me a lot of options when calibrating anything from a super-wide to a long telephoto. My larger targets are properly framed and have proper mounting hardware, but I keep some targets un-framed and just temporarily tape them up for a quick test.
Shooting the Target
I mount my camera (or the lens) onto a heavy-duty tripod, and I use a bubble-level to make sure the camera is perfectly level, with the frame left/right edges perfectly vertical. It’s important to get your lens axis at the same elevation as your focus target center. The analysis software will indicate you have a proper setup by color-coding the measurements in yellow where it sees near-perfect verticals and horizontals (see the ‘annotated’ plots below). The other edges in the analysis will be labeled in cyan (typically edges that are slanted by about 5 degrees). The “little” target rectangles above and below the big rectangle should have cyan measurements on them, since they’re slanted at about 5 degrees.
If you don’t get your camera and target properly leveled, then you will end up getting focus plane measurements that have a ‘tilt' to them, which makes for an ambiguous focus plane and confusing results (and will likely make the software unable to produce correct result plots).
On many Nikons, you can use the “virtual horizon” to get your camera leveled pretty well.
Make sure you have good illumination; you don’t want to make your camera have to hunt for focus.
It’s important feedback that the large target rectangle resolution value displayed in the “annotated” plot is yellow and not cyan. Both the camera frame edge and the target large rectangle edge need to be vertical and parallel. The yellow color confirms this alignment. It’s unfortunate that you have to wait until you run the analysis program to see if the ‘annotated’ plots display this target edge measurement in yellow.
Depending on your camera, you might get better results in you use about a +0.7 stop exposure compensation when shooting the chart. This will often get the white target background to look white; camera meters are still pretty easy to fool.
I take multiple shots of this target, and I de-focus the lens between each test shot and force the camera to re-focus using continuous auto-focus. This simulates exactly how the camera will be used in “real” shooting conditions. Each shot will be focused slightly differently, due to natural camera focus variation, and I’m after the “average” focus distance. I like to use continuous-focus mode and a “single point” focus sensor; this is closest to my own shooting conditions for regular subjects. When I use long lenses, I leave vibration reduction active (the lens still shows a small amount of wiggle as I press the shutter).
In the following example, I set up my focus chart at 48 feet (14.6m) and shot it at 600mm. I use the MTFMapper program to analyze the chart shots, so that I get very precise answers about what’s in focus and what’s not. I found out that yes, indeed the focus calibration was off. Not by a huge amount, but it was generally focusing too far by about an inch (25mm).
The lens used in this example is the Sigma 150-600mm zoomed to 600mm. It lets me calibrate at multiple focal lengths and distances, so I’m testing the calibration combination of 600mm at 48 feet.
A really small target to find small focus errors
The target above is printed and mounted on an 8 ½ by 11 inch piece of poster board. I used spray-on adhesive to attach a Laser-jet print onto the board. It’s a very temporary setup, so I just used painter’s tape to hold the target against a wall. I used a bubble-level to ensure the target is mounted with the big central target rectangle vertical edge perfectly vertical.
The target shown above is intentionally quite small in the frame. I’m testing a 600mm lens here, and I am looking for really small focus changes from really far away. The measurement software is so capable that this scenario works fine for analysis. Your own eyes aren’t good enough for this analysis task, but the software is. Again, the lens axis is rotated 45 degrees relative to the target face, with the target left side farther from the camera.
This shot shows a pretty gross violation of the MTFMapper program expectations. The program expects a shot that mostly fills the frame and is at the specified distance (2.5 meters for this particular chart). Instead, the chart only fills a fraction of the frame and is shot from much, much farther away than the program expects. The software can actually analyze target rectangle edges down to about 40 pixels, but of course more pixels will give better results.
For wide angle lenses, you wouldn’t want to have a target this small in the frame. The depth of focus on this kind of lens will be deeper and will have a more gradual sharpness change than for telephotos. You’ll want to print and mount as large of a target as you can reasonably make when testing this lens type.
For large targets (my largest target is 4 by 5 feet) you’ll get the best results by mounting and hanging them like a large photograph. My large targets have conventional picture-hanging hardware on their backs.
Analyzing the Focus Chart Photo
The MTFMapper program can give you focus chart results in a variety of ways and in a variety of measurement units. To get my preferred “MTF50 lp/mm” resolution units, you need to set your program preferences to match your camera sensor pixel size (in microns).
After the preferences are set/verified, run the focus analysis via the “File | Open” menu option in MTFMapper. Tell the program where your “raw” format photos of the focus chart reside.
Set your camera sensor pixel size
Access the Preferences dialog via the menu “Settings | Preferences” option. Note that both the “Profile” and “Annotation” options are also checked.
MTFMapper ‘annotated’ plot screen selection
The screen shot above is slightly zoomed in to show target measurement details. In this program, you can zoom in by holding down the Control key while using the mouse scroll wheel. Notice that the shot is transformed into black and white.
Here’s your chance to verify that the big target rectangle right-hand side shows an MTF50 measurement displayed in yellow. If the measurement is cyan instead, you should realign the target and/or camera and try again.
MTFMapper Profile plot screen
The Profile plot is generated using the edge resolution measurements of rectangles from the focus chart shot. The vertical blue line represents the right-edge of the large target rectangle.
This plot makes it easy to see where peak focus is located, relative to the blue target line.
Focus target detail with MTF50 edge measurements
The (cropped) shot above shows the center of my focus chart, shot at 600mm from 48 feet away. This is a screen shot of the “annotated” plot from the MTFMapper program. The numbers on the little black trapezoids are resolution measurements in units of MTF50 lp/mm. I always shoot in ‘raw’ format; measurements using jpeg files are vastly different. Again, the left side of this chart is farther from the camera than the right side, rotated by 45 degrees. I used phase-detect focus and aimed my focus sensor at the right-hand side of the large black rectangle (where it’s showing the yellow measurement of “43.8”). The highest resolution edges in this example are generally about 3 “little” rectangles to the left of the big rectangle right edge. This focus error is only about an inch along the lens axis. In this shot, the measurements that are displayed in yellow indicate that those edges are perfectly vertical or horizontal, versus the cyan-color measurements on edges having a slight slant to them.
At this scale, your own eyes are incapable of discerning the edges with best focus with any degree of certainty. To the software, however, it’s easy and totally repeatable.
Don’t place too much confidence in the MTF resolution numbers in this shot, since this isn’t a proper resolution-measuring plot, the target is only a small part of the image frame, and the target (on purpose) isn’t parallel to the image sensor. It’s fair to compare these resolution numbers to other shots taken in the same shooting conditions, however.
I have larger focus targets than the one shown above, but focus targets with smaller rectangles (trapezoids, actually) give me a better idea of exactly where the best focus is located. The measurements show that best focus is further away from the vertical edge I aimed at, and I need to use a “-” focus calibration shift to get the lens to focus closer to the camera. The “large” rectangle is only 2 inches (50mm) tall, and I remind you that I’m shooting this from 48 feet away!
My larger focus targets are generally to be used when I’m calibrating a wide-angle lens.
Profile plot of target from MTFMapper
The profile plot shown above makes it easier to see where the focus lands (at the green line peak). The blue line indicates where the right-hand side of the target rectangle edge is (where I pointed the camera focus point). Clearly, the lens is back-focusing. The little red dots represent each measured tiny rectangle edge resolution, and the green line is a smoothed plot of these measurement averages.
The focus calibration fine-tune will require a (-) adjustment to pull its focus closer to the camera to fix this focus error.
If you don’t have an accurate setup while shooting (or you mismatch the target perspective to the lens), the profile plot might fail to render properly; in those cases, you can just go by the “numbers” on the rectangle edges in the “annotated” plot results to judge where the best focus is, versus where the target vertical edge is.
Note in the plot above that the intersection of the blue line and the green line has a resolution around 44, versus the green line peak of around 54, showing resolution loss of about 10 lp/mm at the desired focus plane. As I mentioned, these resolution numbers aren’t strictly reliable for this style of chart, but they’re at least representative of the loss in resolution. Who could have imagined that a focus miss of about an inch would result in such a big resolution loss on the intended target?
It’s worth noting that some lenses (usually the super-fast lenses) can also shift focus with an aperture change. On these lenses, you need to set the desired aperture for calibration. On most lenses, you just need to set the widest aperture for testing.
Sigma was a pioneer in the sophisticated lens focus calibration arena. They let you calibrate zooms with 16 different focal length/distance combinations. Tamron now provides a very similar calibration feature for their newer lenses. Canon typically only lets you calibrate at two focal lengths on their zooms, while Nikon only gives you a single fine-tune calibration setting (their D6 does allow a ‘wide’ and ‘telephoto’ calibration pair on zooms). Neither Canon nor Nikon let you save any calibration settings within the lens itself.
The Sigma lens focus-fine-tune firmware (and also the Tamron firmware) is smart enough to interpolate all of the in-between calibration settings for the lens focal length and the focus distance. The 500mm calibration would be affected by both the 400mm and 600mm calibration values. Canon cameras that have two-calibration settings can also interpolate, but they have a lot less information to work with.
Sigma Optimization Pro calibration settings
As seen in the sample above, I now have an updated focus calibration for the 600mm setting at 48 feet (-6) and a new setting for the 400mm setting at 20 feet (-9). These two small tweaks got my Sigma perfectly focus-calibrated again at all focal lengths and distances.
If you’re using a Nikon or Canon lens, you have to use the camera focus fine-tune to fix the problem instead of the lens firmware that Sigma/Tamron have.
For my other Nikon cameras, I still have to set the single focus fine-tune value when I mount the Sigma onto them. I can pick any distance or focal length and then run through the same calibration procedures discussed above for that zoom/distance setting; all of (16) Sigma internal lens calibration settings will “go along for the ride”. Each of my cameras is a little different, so even with a calibrated Sigma lens on a different camera, it will still require me to enter the camera fine-tune setting, versus the internal Sigma fine-tune settings. Only the camera that I calibrated the Sigma internal fine-tune settings on will get a “0” camera internal fine-tune value; none of my cameras are calibrated exactly the same.
Improved focus accuracy with new fine-tune calibration
The shot above shows the analysis of the focus target using the new focus fine-tune calibration settings. The focus (and highest resolution measurements) is shifted back to the correct distance. You always need to take several shots and re-focus between each shot. There is a small shot-to-shot variation, and you need to determine where the “typical” focus lands.
Profile plot with new fine-tune calibration
You can see in the plot above how focus has shifted back to where it should be. The expected focus point (blue line) now coincides with the smoothed actual best-focus green-line peak.
If you make a similar plot using a wide-angle lens, the bump in the green line won’t have as steep of a peak in it, since focus changes more gradually.
Focus calibration can get fairly involved, but it’s not rocket science. It is important, however, to get more sophisticated than just manually inspecting the results of a slanted-ruler target photo to calibrate lenses with high precision.
You might also find that your lens will shift focus in temperature extremes. All I can suggest in that case is that you save calibration settings for “cold” and settings for “hot” days. I tape a little piece of paper inside my lens cap with little facts that I’d otherwise forget. In this case, you’d just change the ‘camera’ fine-tune value and leave the ‘lens’ settings alone (on Sigmas or Tamrons).
A small focus error gives you a big resolution penalty. Long lenses in particular need to be calibrated incredibly well, or the intended subject (e.g. the near eye) resolution will pay a terrible price. If quality images are important to you, then spending the time to calibrate lenses properly will reward you with significantly better shots.