A common complaint seen on web photo forums is that cameras (and/or lenses) aren't achieving accurate focus. Sometimes the focus point is in front of the intended subject and sometimes it's behind it. Some of these observations may be due to technical problems with AF, but some are due to user error or unreasonable user expectations.
Of course no manufacturer of cameras or lenses claims that autofocus is absolutely perfect. For example, Canon state that the spec for focus on "consumer" bodies (such as the Digital Rebels and the EOS 20D/30D/40D) is that it should be within the DOF (Depth of Field). On the "pro" bodies (EOS 1 series) focus spec for f2.8 and faster lenses (f4 on some models) is that it should be within 1/3 of the DOF. With slower lenses the AF accuracy of the "pro" bodies reverts to the same as that of "consumer" bodies which don't have the high precision sensors.
So the bottom line is that focus should be within the DOF, or to put it another way, the image should look sharp. If it doesn't look sharp, focus is not likely to be in spec.
Note also that both the camera and lens are involving in focusing. A focusing error can be the result of either a camera or a lens calibration problem.
I've written this article so that users can test their DSLR under a set of "standard" conditions. The lens testing chart which is shown at reduced size below can be downloaded (as a Zipped JPEG) HERE
You can see two sets of parallel lines which are your focus indicators. The numbers 1, 2 and 3 represent 1cm, 2cm and 3cm distances when the chart is used at 45 degrees as explained below. In the center is a single vertical line (or horizontal line, depending on how the target or oriented), and that's your focus point.
To use the lens testing chart you set it up at 45 degrees to the axis of the lens as shown below.The easiest way to do this is to have the camera horizontal and tilt the target back by 45 degrees. You can also lay the target on the floor and shoot down on it with the camera at 45 degrees. In this configuration (with the target at 45 degrees to the optical axis of the lens) the 1, 2 and 3cm distance marks are correct. They are actually spaced at 1.41, 2.82 and 4.23cm from the focus line on the test chart, but when viewed at 45 degrees these distances are modified by the Cosine of the viewing angle (Cos 45 = 0.707). The lens should be at maximum aperture for minimum DOF and maximum sensitivity to focus errors.
Use is easy. Once you have everything setup you select your focus point (let's use the center point) and make sure the focus zone includes only the single focus target line. It's important to note that the area of the AF sensor may not be exactly the same as the markings on the viewfinder screen, so make sure there's nothing near the AF zone but the focus line. Then you take your shots. Take several and refocus each time. Try several manual focus shots also, using Live View with magnification if your camera has that ability. Use the maximum aperture of your lens so as to get minimum DOF.
Below is an example cropped from a frame taken with a EOS 10D using 50mm f1.8 lens at f1.8 and focused manually on the single vertical line. Focus distance was about 0.45m (I have the Mark I version of this lens which has a focus scale, the newer Mark II version does not).
This image displays accurate focus. The "1", "2" and "3" characters are pretty much equally blurred both in front of and behind the focus line. There's maybe a very slight bias towards the front, but on the next manual focus shot you might see an equal bias towards the rear. There's nothing wrong with the manual focus of this this camera or lens. The lines are spaced at 2mm intervals. 1, 2 and 3 represent 1cm. 2cm and 3cm distances in front of and behind the focus line. Note that at longer focus distances the DOF is not symmetrical about the focus point and you should see slightly more DOF behind the point of focus than in front of it. The important thing is that the lines at the zero position (at which you focus) are the sharpest.
The next shot shows the same view, but taken using autofocus.
Here you can see a slight bias in front of the focus line. The "1 cm" mark is sharper in front of the focus line than behind it, though the focus line itself is still quite sharp. I'd estimate that focus is maybe 2mm in front if the focus line, but the line itself is still within the "sharp" zone, maybe close to the rear limit of the DOF. For a 50mm lens at f1.8 focused at a distance of 0.45mm the calculated DOF is 5mm (+/- 2.5mm). So the focus isn't "perfect" but it's pretty good and within spec for autofocus. I'd suspect that such small focus offsets are pretty common but nobody ever notices them. Below is the same shot at f5.6 and the focus offset is undetectable to my eyes due to the increased depth of field at f5.6.
The distance between the target and the camera should be whatever you typically shoot at, or about 25x the focal length of the lens if you want the best assessment of general focusing accuracy. If you are too close and get into the macro range, it's possible that focus errors could be different from what you might observe at infinity. Just be sure that the focus zone of the camera only covers the single focus line. If you are so far away that the focus zone extends across the other marks, print the target larger to compensate. If you double the size of the target, the 1cm, 2cm, 3cm marks will become 2cm, 4cm and 6cm respectively.
If you get great, sharp, properly focused images using manual focus (liveview + magnification), but your shots using AF are off focus, you have a couple of choices, depending on which lens and which camera is involved. Either the lens or the camera could be out of adjustment, but if only one or two lenses seem to have a problem and the rest don't, then it's probably a lens issue. If every lens you own has a problem, then it may be a camera adjustment issue.
The equipment manufacturer can make focus correction adjustments to their cameras and lenses so you can send either (or preferably both) of them off for the manufacturer to calibrate and adjust. However if you are shooting with a camera that has microfocus adjustment (like most current EOS DSLRs except for the Rebel series), you can make corrections yourself.
Canon EOS AF adjustment can be done in +/- 20 steps and the camera remembers the lens and only applies the correction when that particular lens (actually lens type) is mounted. You can find the right amount of adjustment pretty easily by systematic trial and error. You might start out trying shots at 0, -5 and +5 settings. If the focus looks better at +5 than at 0 then you know you need to add a +ve adjustment. Try +10. If +10 is not as good as +5 then you know the right number is less then 10. If +10 is better than +5 then you know the right adjustment is more than +5. You keep on iterating until you have the best focus and at that point either reducing or increasing the AF adjustment makes the image less sharp.
A few Sigma lenses are compatible with their "USB Dock". If you attach a compatible lens to the USB dock you can use a computer to adjust the lens focusing parameters. However it only works with Sigma lenses and only with a few of their newest ones (35/1.4, 17-70/2.8-4 and 120-300/2.8 as of 11/13)
Some DSLR models from Nikon, Sony, Olympus and Pentax also have AF microadjustment capability. Generally the more recent, higher end, models have the feature, but you'll have to check with the camera manual to be sure.
Here's a list including cameras released up to around 2013:
Canon: 1Dx, 1DsMk3, 1DMk3, 1DMk4, 5DMk2, 5DMk3, 7D, 6D, 70D, 50D (note not the 60D)
Nikon: D4, D3,D3x, D3s, D300, D300s, D600, D700, D800, D800E, D7000
Sony: A900, A850, SLT-A77, SLT-99
Olympus: E-30, E-620, E-5
Pentax: K20D, K2000, K200D, K-5, K7D, 645D