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.