• site home
  • blog home
  • galleries
  • contact
  • underwater
  • the bleeding edge

the last word

Photography meets digital computer technology. Photography wins -- most of the time.

You are here: Home / D850 / 70-200/2.8E at 200mm D850 PDAF tuning

70-200/2.8E at 200mm D850 PDAF tuning

January 4, 2018 JimK 3 Comments

This is a continuation of a series of posts on the Nikon D850.  The series starts here. You should be able to find all the posts about that camera in the Category List on the right sidebar, below the Articles widget. There’s a drop-down menu there that you can use to get to all the posts in this series; just look for “D850”.

In this post, I looked at FocusTune analyses of the Nikon 70-200/2.8E lens. Several folks criticised my using FocusTune to look at phase-detect autofocus (PDAF) variability in the D850, correctly pointing out that it is a black box and we don’t know exactly what it’s measuring. 

For the last couple of days, I’ve been writing code to do something similar, but in a way that I understand. 

Let’s go back to one of the graphs from the earlier post, with the lens set to f/2.8 and 200 mm. 

Here is a plot from my code with the same image set:

I’ve just plotted the green channel of the AdobeRGB JPEG images. Presumably, FocusTune uses a luminance measure. That turns out not to be important here, as we’ll see further on. Both plots say that the right AF adjustment value is +3. The FocusTune plot is prettier — give me time; I’ve just started this project. One difference is that my vertical axis is calibrated; it’s the shift of the focus point in millimeters, with positive numbers indicating shifts away from the camera (back-focusing) and negative ones indicating shifts towards the camera (front-focusing).

The sharpness measure I am using is Brenner’s  focus criterion (Santos, A.; de Solorzano, C. O.; Vaquero, J. J.; Peña, J. M.; Mapica, N. & Pozo, F. D. “Evaluation of autofocus functions in molecular cytogenetic analysis”. 1997. I’m using some code that lets me pick from a wide variety of such criteria. Brenner’s was only the second one I tried, as seems to work quite well if the data is properly smoothed. The smoothing that I’m using is one of the options in Matlab’s smoothdata function. Here’s what Matlab has to say about the smoothing option I’m using:

'rloess' — Robust quadratic regression over each window of A. This method is a more computationally expensive version of the method 'loess', but it is more robust to outliers.

I tried fitting a double Gaussian with Nelder-Mead, and that works most of the time and is probably fractionally better, but it fails to converge properly about 3% of the time, and it computationally expensive, so I dropped it. 

Here’s what all three channels look like:

As you can see, the variation in the channels due to longitudinal chromatic aberration (LoCA) is small compared to that of the PDAF system. The red channel tends to focus behind the green and blue ones. 

Here’s what FocusTune thought about the same lens at the same focal length, but at f/8:

Note that the variation along the vertical axis is about a third of what it was at f/2.8. I found that curious. The scatter is also less. That is strange as well, if the vertical axis is a distance measure. 

Here’s what I got for the green channel:

I apologize for the different vertical axes for my f/2.8 and f/8 plots. the span of the one about is 120 mm and the f/2.8 plot’s span was 160 mm. The amount of shift distance is about the same in the two plots, as I’d expect. The scatter is also about the same.

For completeness, here are all three color channels:

I call this a good beginning. Next, I’ll try to teach my code some trick that FocusTune doesn’t know so that I can look directly at focus shift vs f-stop.

 

D850

← a7RIII and D850 use comparison Nikon 105/1.4 on D850: CDAF, PDAF, focus shift →

Comments

  1. Andre Y says

    January 8, 2018 at 11:57 am

    Jim, do you know how sensitive Brenner’s method (or other focus measure functions) are to slight changes? I’ve noticed that when using FocusTune, if there are slight shifts, like on the order of 1mm, of where on the target the camera is pointing, the results aren’t really comparable. Also if it’s overly sensitive, it may be responding to other factors that aren’t being measured.

    For example, I shoot a series at 5-point AF tune intervals for the full range of adjustments (ie. 0, +5, +10, …, -5, -10, etc.), and then shoot 1-point intervals around the area which crosses the X-axis to find the closest AF tune number. When I use both data sets in the same director for Focustune, the 1-point numbers tend to be shifted as a whole relative to the 5-point numbers. But when I analyze them separately, the AF tune number they predict seem to be more in line with the 5-point series.

    The reason there’s a slight shift in my setup is because my tripod (an RRS TVC-34) is on carpet, and I think just the act of removing and inserting the memory card in between the 5- and 1-point runs is enough to shift the camera slightly.

    I also wonder how the focus measure functions react to lens aberrations, which may be important since some lenses clean up quite a bit when they’re stopped down.

    Reply
    • JimK says

      January 8, 2018 at 12:14 pm

      With the LensAlign ramp, Brenner’s method results in a measure that has periodic variations. That’s because the pattern spans several pixels, and as you track over it at one-pixel intervals, you’re seeing different parts of the pattern. I deal with that by applying a smoothing function. Choosing the right function is somewhat of an art, and I look at the smoothed and raw plots for each data point to make sure there’s nothing wonky. Once I get more confidence, I’ll stop doing that. I don’t know how FocusTune smooths, but I’m pretty sure they have to do so.

      WRT the carpet, I think that’s a bad idea. I use vinyl tile on a concrete floor.

      If you’re worried about the memory card, have you considered shooting tethered? But I think you could do your runs at 4-step intervals and interpolate, and dispense with the 1-step runs entirely.

      Here’s some comfort. The shot to shot variations of PDAF are so great that I think it’s futile to try to get the AF adjustment to within one integer difference of some theoretical perfection. When I worked at IBM, the folks had a phrase for that, which I won’t repeat, but it started “polishing a…”

      Reply

Trackbacks

  1. Sigma 135/1.8 on D850: CDAF, PDAF, focus shift says:
    January 7, 2018 at 11:11 am

    […] a previous post, I reported on my progress in developing a software tool to process image sets made of a LensAlign […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

May 2025
S M T W T F S
 123
45678910
11121314151617
18192021222324
25262728293031
« Apr    

Articles

  • About
    • Patents and papers about color
    • Who am I?
  • How to…
    • Backing up photographic images
    • How to change email providers
    • How to shoot slanted edge images for me
  • Lens screening testing
    • Equipment and Software
    • Examples
      • Bad and OK 200-600 at 600
      • Excellent 180-400 zoom
      • Fair 14-30mm zoom
      • Good 100-200 mm MF zoom
      • Good 100-400 zoom
      • Good 100mm lens on P1 P45+
      • Good 120mm MF lens
      • Good 18mm FF lens
      • Good 24-105 mm FF lens
      • Good 24-70 FF zoom
      • Good 35 mm FF lens
      • Good 35-70 MF lens
      • Good 60 mm lens on IQ3-100
      • Good 63 mm MF lens
      • Good 65 mm FF lens
      • Good 85 mm FF lens
      • Good and bad 25mm FF lenses
      • Good zoom at 24 mm
      • Marginal 18mm lens
      • Marginal 35mm FF lens
      • Mildly problematic 55 mm FF lens
      • OK 16-35mm zoom
      • OK 60mm lens on P1 P45+
      • OK Sony 600mm f/4
      • Pretty good 16-35 FF zoom
      • Pretty good 90mm FF lens
      • Problematic 400 mm FF lens
      • Tilted 20 mm f/1.8 FF lens
      • Tilted 30 mm MF lens
      • Tilted 50 mm FF lens
      • Two 15mm FF lenses
    • Found a problem – now what?
    • Goals for this test
    • Minimum target distances
      • MFT
      • APS-C
      • Full frame
      • Small medium format
    • Printable Siemens Star targets
    • Target size on sensor
      • MFT
      • APS-C
      • Full frame
      • Small medium format
    • Test instructions — postproduction
    • Test instructions — reading the images
    • Test instructions – capture
    • Theory of the test
    • What’s wrong with conventional lens screening?
  • Previsualization heresy
  • Privacy Policy
  • Recommended photographic web sites
  • Using in-camera histograms for ETTR
    • Acknowledgments
    • Why ETTR?
    • Normal in-camera histograms
    • Image processing for in-camera histograms
    • Making the in-camera histogram closely represent the raw histogram
    • Shortcuts to UniWB
    • Preparing for monitor-based UniWB
    • A one-step UniWB procedure
    • The math behind the one-step method
    • Iteration using Newton’s Method

Category List

Recent Comments

  • bob lozano on The 16-Bit Fallacy: Why More Isn’t Always Better in Medium Format Cameras
  • JimK on Goldilocks and the three flashes
  • DC Wedding Photographer on Goldilocks and the three flashes
  • Wedding Photographer in DC on The 16-Bit Fallacy: Why More Isn’t Always Better in Medium Format Cameras
  • JimK on Fujifilm GFX 100S II precision
  • Renjie Zhu on Fujifilm GFX 100S II precision
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • Ivo de Man on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF

Archives

Copyright © 2025 · Daily Dish Pro On Genesis Framework · WordPress · Log in

Unless otherwise noted, all images copyright Jim Kasson.