DIY Autofocus Target
Part 3 Camera Alignment
Part 3 of 4 in Designing and Building an Autofocus Calibration Target
The actual alignment of the camera and target is certainly one of the major considerations, if not in the accuracy of the test, at least in how easy it is to setup for the testing.
One strategy is simply to do what I suggested in the previous article and use a tape measure to position the target in the necessary spot. It works, and can be accurate enough to get everything close enough to make for accurate measurements. However, it doesn’t make an easy quick way to setup the sight.
To do that there needs to be a sighting system of some sort. There are several ways to approach the sighting problem, but before I look at them, accuracy and depth of field must be considered.
Accuracy and Inaccuracy as Imposed by Depth of Field

This image shows the effect of defocusing as objects are moved away from the plane of exact focus (center pin). When the spot size is equal to the width of the the object (right most pin) the object blurry but still can be used to sight with. However, when the spot size grows to 2x the width of the object (left most pin) the object is blurry enough to make it difficult to sight with.
Most simple sighting systems work by aligning two or more sight points. When the sight points are aligned, the camera is aligned with the target. This strategy requires placing at least one of the “sights” either in front of, or behind, the other.
Accuracy is dependent on the distance between the two sight points, the longer the distance the more accurate the alignment can be. However, this presents a problem in this application, due to depth of field.
One way to simplify the target design and construction is to use the target itself as one of the sight points, with the second sight point either in front of or behind it. As a result, the useable depth of field is in turn halved.
The question ultimately is how far from the target can the second sight point be before it’s unusably blurred.
Fortunately, several factors allow the design to be simplified further. First, we can do the sighting at an aperture narrower than the lens’s wide-open aperture. In fact, due to the way modern SLR viewfinders are designed, at least in part, sighting thought he viewfinder will act as if the lens was stopped down to f/4 or f/5.6.
Further simplifying things, is that testing is typically conducted at a multiple of the focal length—it doesn’t necessarily need to be 50x either, as long as the multiplier is held constant. This reduces the depth of field calculations to being dependent on just the aperture. In other words, all f/2.8 lenses will have the same depth of field at the test distance regardless of their focal length.
Using both simplifications it’s possible to calculate how far away from the target the second sight point can be.
Calculating the Limits Imposed by Depth of Field
The easiest way to compute the placement of the second target point is work the depth of field process in object space (where things are) as opposed to image space (at the sensor) like it’s usually done.
For this, I use an equation presented by Harold Merklinger, in his book The Ins and Outs of Focus. This is based on the geometry of the scene and nothing else. Moreover, I make a simplifying assumption that the distance from the lens to the subject is equal to the distance from the film plane to the subject. In reality they are slightly different (<10% at the 50x testing distance) but close enough that it doesn’t introduce enough error while greatly simplifying finding the center of the lens.
The formula used is show below. S is the spot size, L is the distance in front of behind the place of exact focus, D is the distance from the lens, and ‘d’ is the aperture diameter.
Further applying the simplifying assumption discussed above, that the testing distance is always a multiple of the focal length—in this case, 50—the formula can be simplified as show below.
Where N is the aperture of the lens as express by the f-number and L is the same as above.
S is simply spot size where the target is unusably blurred. In practice, this works out to be twice the width of the target itself. Using this equation, we can solve the practical maximum sight point distance for any given aperture when the target is 50-times the focal length away from the camera.
Additionally the simplifying assumption based on viewfinder accuracy can be applied here to simplifying things further (reducing N to either 4 or 5.6).
For example, if an Xacto #11 knife blade was used as the front target point, S is 0.04 inches (0.5mm). Using f/4 as the sight aperture, and 50x the focal length as the testing distance, L, the upper limit for the front point is 8 inches.
Thinking about the Design
Knowing the limits is one thing, designing the target is another. If we stop and take a moment to look at the commercial Lens Align products, their sighting system utilizes a hole in the center of target board and a rear placed sight post. This is certainly guaranteed to have you pointing at the center of the target when it’s properly aligned, but it increases the complexity of a DiY solution.
One possible simplification is restricting the number of degrees of freedom the target has to deal with.
The sighting system serves to align things in 3D space where there are 6 degrees of freedom in which the camera needs to be orientated. However, if you begin to constrain those degrees of freedom the alignment problem becomes simpler.
For example, constraining the camera and target somehow would seriously constrain the number of angles that need to be dealt with. One such way is to insure the camera and target are level and that the center of the lens is at the same height as the center of the target. Doing this reduces the problem to a single angular error (yaw) which can be dealt with by a single vertical sight.
The problem of insuring alignment still exists, to some degree however, as I showed in the last section there’s a fairly large amount of room for error in placing the camera.
Another simplification is that the alignment points need not be placed in the center of the target. Removing that constraint removes the difficulty of placing an opening that has to be closed in middle of the alignment surface. Actually, this can be dealt with by having the target itself slide into the “holder” covering the alignment sight.
Fortunately, it’s not necessary to have the alignment marks in the center of the target. Perspective that even off center alignment marks will become centered when the target is aligned. In other words, a set of pins or other sighting marks can be placed around the target such that the line up with marks on the target instead of being centered.
The key consideration here is insuring that the center of the target is clear of things that could throw off the autofocus system.
In my prototype, I used both simplifications I just noted. My alignment pin is a hobby knife blade stuck in the front of the base plate about 6” in front of the target, well inside the DoF limits for an f/4 lens at the 50x test distance. Additionally, I only use a single sight point to align the yaw of the target relative to the camera, relying on both leveling the target and camera, and setting the camera so the lens is centered at the same height as the target.

On my prototype target, when the hobby-knife blade is aligned with the red mark on the target proper, the camera is aligned with respect to yaw.
So far, in the first 3 parts of this series I’ve covered how to calculate the allowable error that can exist in the flatness construction of the target, as well as the alignment (skew) of the target to the camera. This is limit is determined based on the AF adjustment size, testing distance, and fastest lens that needs to be tested and the camera’s sensor format. This part took a more in depth look at the problem of alignment, and some ways to solve it. Next time I’ll be looking at the actual target pattern.

Reader Comments
Pingbacks