Edit: After further testing and analysis, some of the conclusions have been revised. Notably, ten of the eleven lenses would have been within an acceptable focus tolerance using the original AFFA settings under FW 1.01, although not necessarily optimal. Five settings would have been at the margins, i.e., just barely acceptable or slightly blurred. It is possible that several minor AFFA changes could have been prompted by a margin of error in the test methodology, depth of field allowances, or tolerances in the camera's AF system. It is believed that sufficient numbers of AFFA test runs were conducted to support a robust analysis.
Summary
This article describes the changes in the
Autofocus Fine Adjustment (AFFA) settings that were necessary after the author updated the firmware in a
K-3 Mark III DSLR camera from version 1.01 to v1.31 in December 2021.
Using a repeatable quantitative methodology to calibrate the optimal AFFA settings, most of the eleven lenses in the procedure were found to require new AFFA settings for optimal AF performance. Because of the inherent depth of field allowances under the test conditions, ten lenses would have been within an acceptable focus tolerance using the original AFFA settings under FW 1.01, although not necessarily optimal. However, five of these lenses would have been at the margin of the acceptable range if their AFFA settings were not reset under FW 1.31. Notably, one lens, a DA 18-135mm, required a significant change in AFFA setting from minus 6 originally to plus 2 under FW 1.31.
It is possible that several minor AFFA changes reflect a margin of error in the test methodology, depth of field allowances, or tolerances in the camera's AF system. Because Ricoh Imaging had released intermediate firmware versions, it is not possible to determine whether the substantive AFFA changes were introduced in FW v1.31 or in a previous version.
Introduction
Many online articles, guides, and forum comments attest to the need to ‘calibrate’ or fine-tune the autofocus (AF) of lenses on a DSLR when using the viewfinder and phase-detection AF. Without such fine tuning, achieving high focus accuracy and precision is difficult. While DSLRs have demonstrated improved AF performance over the years, users still observe mis-focused shots, lack of focus consistency, or focus quality that varies with subject distance, aperture, or zoom setting.
The author’s experience with a substantive change in AFFA settings caused by a firmware update in another Pentax camera caused some apprehension to update the K-3 Mark III, despite the apparent benefits of the new firmware. Other users have also reported anecdotally that certain firmware updates – but not all – prompted them to recalibrate their lenses on their K-3 Mark III or other cameras. Regrettably, the scant descriptions that Ricoh Imaging usually publishes with each firmware update generally do not reveal changes in AF performance or the potential need to change AFFA settings.
This article addresses the specific case of updating the author’s K-3 Mark III from firmware v1.01 directly to v1.31. It also touches on approaches for calibrating lenses and highlights the author’s quantitative methodology.
Phase Detection Autofocus
Phase detection autofocus (PDAF) is a primary focus mode in Pentax digital SLR cameras, and its focus sensor is active whether the camera is in AF or MF mode. Apart from the focus issues that may arise from a subject’s lighting, contrast, or physical features – or from user error – autofocus performance may be degraded also by systematic errors in the PDAF sensor and its optical path. Other sources of error include the necessary play in the lens focus-actuation mechanisms and tolerances in the focus control system such as deadbands or hysteresis.
When focusing automatically, Pentax photographers usually rely on the focus indicator, which is the Green Hexagon seen in the viewfinder. An audible ‘beep’ may also be enabled. Basically, the hexagon lights when the camera ‘thinks’ a good focus has been achieved and the shot may be taken. However, the focus system may be fooled: The PDAF sensor and its lens-to-detection sensor optical path may be misaligned, which results in mis-identification of accurate focus, i.e., ‘front focus’ or ‘back focus’ situations. Furthermore, the optimal AF for some lenses may be different depending on whether the lens focuses from a starting position that is farther than the actual distance to the subject, or nearer. To further complicate matters, individual zoom lenses may require different AFFA settings at different focal lengths.
These problems may be mitigated by careful in-body lens calibration, known as Auto Focus Fine Adjustment in the Pentax context. Other brands and users call it ‘AF micro adjust’, ‘AF fine tune’, ‘lens calibration’, ‘dialing in the AF’, or other similar terms.
Auto Focus Fine Adjustment – AFFA
To overcome possible PDAF detection and indication errors, it is feasible to calibrate the focus detection path uniquely for each lens. Essentially, an AFFA procedure reduces the back- or front-focus errors that have been induced by the focus detection system.
There are several basic techniques for calibrating lenses:
- Visually inspecting a series of images
- Inspecting images of slanted rulers or scales to determine front- or back focus
- Visualizing Moiré effects on a computer monitor
- Comparing focused lens settings, alternating between Live-view and PDAF
- Setting the best focus manually in Live View and using the viewfinder focus indicator to determine the AFFA range for acceptable focus settings; picking the median value
- Quantitatively analyzing image sharpness.
Depending on the technique employed, do-it-yourself focus targets may include arbitrary subjects of opportunity (e.g., distant utility structures, backyard objects, cereal boxes); flat targets affixed to a wall or panel (e.g., newspapers, banknotes); and custom-printed target images. Alternatively, commercial products are also available, which provide a pre-made target fixture and slanted scale.
Many useful online sources provide good guidance on how to recognize AF errors and to calibrate your lenses. Ricoh Imaging also gives guidance for optimizing focusing accuracy with large-aperture lenses (
How to optimize focusing accuracy with large-aperture lenses / explore | RICOH IMAGING)
Quantitative analysis requires a rigorous approach and rewards strict attention to details with repeatable numerical data that can be used to determine various aspects of focus accuracy and precision. Commercial calibration products, such as the Reikan
FoCal application, offer useful integrated software and detailed instructions for setting up and performing such a calibration procedure.
AFFA Methodology used in this Study
As an essential component of the author’s lens-calibration efforts over the years, a quantitative methodology was progressively developed independently of commercial products. The approach features several key elements:
1. Flat, high-quality printed targets
2. Rigorous test set-up and execution
3. Multiple test runs for each calibration procedure
4. Primary analysis using the ImageJ open-source scientific image analysis package (via its Fiji distribution, which bundles many useful plug-in modules)
5. Spreadsheet-based data organization, calculations, and plots
6. Logbook and notes.
It should be noted that it is also possible to calibrate lenses using simpler techniques as listed in the previous section. Further insight into this possibility is provided near the end of this paper.
Focus target and camera set-up. The focus target consists of a crisp black cross to provide a high-contrast, unambiguous AF target, and other graphical elements to facilitate visual image inspection and comparison. The targets are printed at high resolution on matte or lustre photo paper at 8.5 x 11 inches (US letter format), and mounted on a flat foamboard of 12 x 18 inches (30 x 45 cm). Figure 1 shows the actual target version that is currently in use.
The target board is mounted on a tripod using a custom-built fixture that keeps the target planar and enables accurate parallel and centred alignment between the target plane and camera sensor. The camera itself is mounted on a separate Sirui N2204 tripod using an FLM CB-38F ballhead. The camera sensor plane and target are separated by a measured distance, typically at D = 25 to 50 x focal length.
The equipment is set up in a residential basement workshop on a concrete floor, which accommodates target distances of up to 7.5 metres. A possible mechanical source of vibration, a nearby central-heating furnace, is temporarily turned off during image acquisition.
Lighting. The lighting source consists of compact fluorescent lamps (CFLs) rated at 23 W (equivalent to 100-W incandescent), colour temperature 6500 K, fitted in workshop lamps with 20 cm polished aluminum reflector shades. The target is illuminated by two lamps at a distance of approximately 100 cm, positioned on either side to avoid glare from the target’s surface, while providing uniform illumination across the target. The CFL bulb type has a low ‘flicker’ amplitude. The lighting intensity may be controlled readily by adjusting the angle of the lamp reflectors while still maintaining a uniform lighting pattern.
Exposure. The lens aperture is normally set at or near its widest aperture to provide a shallow depth of field, and spot exposure metering is used. Shutter speeds may be slower than 1/40 s to ensure that the exposure duration is longer than the residual cyclical illumination variation of the CFLs (i.e., 60 Hz in Canada), although faster shutter speeds result in only minor exposure variations from shot to shot. The shutter is released using an infra-red remote.
Experience and specific tests have shown that using the ‘mirror up’ function usually is not required in this procedure. During the tests described here, the Sigma 70-200mm lens at 70mm and 200mm provoked ‘mirror shock’ image blur at 1/30 s, i.e., image ghosting. Such a blur did not appear at 1/200 s, 1/30 s with mirror up, or in Live View (when the mirror is up). The investigation did not examine various shutter speeds to determine the onset of the blur.
Image Collection. The camera is set to capture JPEG images at their highest resolution. The in-camera Custom Image is set to ‘Natural’, with all parameters such as contrast, sharpening and saturation, set to zero or neutral.
Focusing procedure. The camera’s single centre focus point is used, either Spot or Select Single. For each lens, several AFFA runs are made starting from each of the infinity and ‘near’ focus positions. In each run, the camera’s AFFA setting is stepped manually from -10 to +10 in increments of 2 units (-10,-8,-6, etc.), resulting in a series of 11 JPEG images. Stepping by 2 units is sufficient for AFFA calibration; single-unit steps are not essential with the method used here. The camera is allowed to rest momentarily before the shutter is released.
Image focus analysis. Primary image analysis uses the ImageJ Calculate-Quality plug-in. As described by its author, this plug-in is “used for assessing the relative quality of a stack of images. The output is a listing of the ‘quality’ factor for each image in the stack. The factor is computed by taking the sum of the differences of adjacent horizontal and vertical pixels. This is done at three different scales (original size, half size, and quarter size). Images that contain a lot of contrast and sharp edges should have a higher quality factor using this method.” (
Plugins for Astronomical Image Processing with ImageJ | Observational Astronomy). (Note: the plug-in source is no longer available at the website.)
The plug-in outputs a set of data that is used to determine the best focus in a series of imported images, exploiting the phenomenon that unfocused images are more blurry than focused ones. Effectively using image blur as a proxy for focus quality, this approach determines
relative focus quality, not absolute resolution or sharpness that is available from other techniques such as MTF mapping.
The imported images are cropped to a central section of the target, typically giving image ‘chips’ of roughly 800 x 800 pixels, depending on the focal length of the particular test run. The data is copied into a separate spreadsheet for each lens. The focus quality numbers are normalized to the sharpest image and scaled to a maximum value of 10, i.e., the sharpest image is rated at 10 and the others less than 10. The data is plotted using the spreadsheet's charting function, in which the 'relative focus quality (RFQ)' is shown at each AFFA setting.
ImageJ provides a convenient function that allows one to scroll through a series or ‘stack’ of co-registered images sequentially in a single window, making an easy job of visually comparing images or confirming the best-focused image. Other useful functions include zooming, brightness and contrast adjustment, colour balance, and histogram display, amongst many others. Similarly, the package includes an impressive array of complex image analysis functions.
Example AFFA Cases
Two example calibration cases are illustrated here – the SMC Pentax FA 43mm f/1.9 Limited and the SMC Pentax DA 18-135mm zoom.
Pentax FA 43mm f/1.9 Limited. The first example looks at the
before and
after AFFA settings under FW v1.01 and v1.31. Salient exposure settings were ISO 160, f/2.8, 1/30 s, and target distance 200 cm (approximately 50 x FL). In the sample results shown in Figure 2, we see that the sharpest image is produced at AFFA = 0 for either focusing from infinity or the near side. Each pair of plots shows similar results, and the RFQ data is fairly tight overall.
The dashed line at RFQ = 8.5 represents the threshold above which there is no subjective, apparent difference in focus quality when images are viewed at 100% scale on a high-definition 1920 x 1200 24 inch computer monitor at a normal viewing distance. This value has been determined empirically by the author after examining hundreds of images in the course of calibrating various lenses. In this example, any of the AFFA settings between -3 and +3 would result in acceptable focus sharpness when the image is displayed at full scale.
Crops of several images from the 5b 4597 series of Figure 2b (FW 1.31) are shown in Figures 3, 4, and 5. The crops are smaller than 100% full scale.
Pentax DA 18-135mm. The second example shows results that illustrate the tighter AF control that is possibly afforded by FW 1.31.
The DA 18-135mm lens required a significant adjustment to its AFFA setting, from minus 6 under v1.01 to plus 2 under 1.31. The graphs in Figure 6 show consolidated data from all of the runs in each FW version.
As shown in Figures 6 and 7, under v1.01, the AF exhibited messy shot-to-shot inconsistency and variations across similar run conditions, especially at the unfocused AFFA values. FW 1.31 appears to control the focus much more tightly, giving a solid optimal AFFA setting of +2 and a range of AFFA settings above an RFQ of 8.5 that would give acceptable focus results.
New AFFA Settings for the Lens Collection
A similar test procedure was conducted for the AF lenses in the author’s kit. A summary is given in Figure 8, which shows the optimal AFFA setting for each lens, as well as the range of settings over which the focus is acceptable when viewing an image at 100% at a normal viewing distance.
Notably, most of the lenses would have performed satisfactorily if the AFFA settings had been left at their FW v1.01 values, but not necessarily at their best settings. However, five of the lenses would have been at the margin of the acceptable quality ranges. In particular, as mentioned above, the optimal AFFA setting for the DA 18-135mm shifted dramatically.
Using Simpler AFFA Approaches
This article describes a detailed approach to calibrating the autofocus of lenses. Such calibration possibly may be achieved using the simpler qualitative approaches listed in the AFFA section above, providing that sufficient rigor is exercised in setting up and executing the calibration.
For example, several sets of images may be taken of a convenient flat target while stepping through the AFFA settings and focusing from either the infinity or MFD positions in each set. The resulting images may be inspected visually to identify the sharpest image and its corresponding AFFA setting. In certain cases in which several ‘adjacent’ images are indistinguishable in focus quality at 100% viewing, the AFFA setting does not need to be precise. In most cases, a single image will stand out clearly as the best.
Along with their speed and ease, the qualitative approaches have weaknesses. They do not generally provide an indication of the sensitivity of the relative focus quality to the AFFA settings in a series, nor do they give a clear idea of the AF consistency from shot to shot. In certain cases where the range of acceptable focus quality extends to the AFFA limits of -10 or +10 (e.g., the Sigma 70-200 here), it might not be possible to determine the optimal setting.
The detailed quantitative approach used here requires time to set up the camera, target, and lighting and to collect and analyze the image data. The author typically takes about 15 minutes to set up for a series of image runs and 15 minutes to acquire, record, and analyze four runs of images for one prime lens. If the focus quality data is ‘well behaved’ as in the example of the FA 43mm Limited, no further calibration is required. For zoom lenses, at least two focal lengths are tested, which requires more time. On average, several prime lenses can be calibrated in an hour.
The example of the DA 18-135mm shown in Figures 6 and 7 illustrates the benefit of a rigorous quantitative methodology, including an indication of the tighter AF control that the new firmware appears to implement.
Conclusion
This article demonstrates that the AFFA settings needed to be re-calibrated after installing firmware version 1.31 to replace v1.01 on a specific K-3 Mark III.
It is possible that several minor AFFA changes reflect a margin of error in the test methodology, depth of field allowances under the specific test conditions, or tolerances or drifts in the camera's AF system. Because Ricoh Imaging released intermediate FW versions, it is not possible for this study to conclude whether the noted substantive changes were introduced in v1.31 or in a previous version.
Owing to AFFA differences that are possible amongst serials of the same camera or lens models, other users may experience different requirements in their AFFA settings under a firmware update. It is recommended that users test the focus after updating their camera.
The methodology used here requires time and care to follow a rigorous Auto Focus Fine Adjustment procedure. However, the approach offers several benefits, including repeatable tests, a convenient reference record, and insight into various aspects of the AF operation of the camera and lenses.