Tuesday, 9 December 2014

Lens Calibration revisited

Regular readers of this blog will remember that, as an archetypal (i.e. anally retentive) engineer, I like to ensure that all the equipment I use is properly calibrated.  This was driven home to me forcibly when I started to get focus problems in the middle of nowhere.  In an attempt to knock the problem on the head, I acquired a Spyder LensCal and decided to do the job properly.  Needless to say the LensCal tool was significantly less easy to use than I'd hoped, with much of it being down to the difficulty of ensuring that the device and the sensor were parallel.

I've always liked Keith Cooper's Northlight Images site, and happened to come across an article called Camera AF Microadjustment - for free.  Being a dyed-in-the-wool Yorkshireman - and a frustrated lens calibrator - it was obviously worth a look.

Cutting a long story short, the technique relies on the fact that digital cameras take discrete samples (i.e. pixels).  A side effect of sampling is that capturing detail of a similar resolution to the camera's sensor will result in aliasing artefacts - often visible as Moire Patterns.  Checking focus is simplicity itself: display an image with very fine detail on a monitor, and attempt to focus on it with a camera.  Then adjust the focus calibration until the visibility of the Moire Pattern is maximised.  Unlike other techniques, spotting the critical focus position is very easy; and, by moving the focus ring manually after auto-focus, it's possible to determine whether the camera is front- or back-focusing.  Keith gives a link to download a suitable pattern file on his site, but in case this doesn't work I've put a copy here.

The setup I used was to link my laptop to a full-HD television using HDMI (the Moire image is 1000px square, so almost fills the screen).  As Keith explains, it is essential that the image is displayed at 1:1 resolution (I used Photoshop in "full screen" mode) as any scaling will introduce its own artefacts.

Using a television rather than a monitor has the advantage of being: (a) large; and (b) vertical.  I found that positioning the camera so that it was properly aligned was actually pretty straightforward.  This is partly because the rectangular frame of the TV was easy to align in the viewfinder, but also any misalignment was instantly visible since different parts of the image would "snap" into focus at different times.

Because of problems with scaling and sampling, the two images below may or may not show the effect I'm trying to demonstrate.  The first image is exactly in focus, with lots of interference patterns being visible.  The second image is very slightly out of focus, and the interference patterns - although present - are less distinct.

I went through my set of lenses, noticing that - while a few of them agreed with the LensCal results - many were significantly different.  The proof of the pudding was in the eating, though, and I tested all the lenses with their new calibration settings.  Each one was absolutely spot on having used the Moire method, which I guess is the clincher.

Here are two examples showing the full frame and then a 100% crop from two of the lenses whose calibration data changed significantly.  The first example uses the EF 50/1.8 mk1 and the second uses the EF 85/1.8 USM.  Both are shot at f/1.8.

While it's slightly worrying that the calibration data changed so much (the 85 went from -2 to -8, and the 50 went from +14 to -6!), I now have significantly more confidence that my lenses are set up correctly than I did before.

It's well worth reading Keith's article, and I'd be very interested to hear from anyone else who has tried the technique.  Not only is it free, but it actually seems to work!