Thursday, January 23, 2020

2020 Reflections on Focus: Part 1

As many know, I’ve enjoyed myself for some time trying to get the best out of focusing; especially in the following areas:
• Always knowing the impact of diffraction blur on my captures
• Always knowing the near and far depth of fields (DoFs)
• Understanding the impact of the defocus blur criterion, ie the so-called Circle of Confusion (CoC)
• Understanding the impact, especially for non-macro, but close-up or near-field photography, of not knowing the ‘lens zero’
• Knowing how many focus brackets I will need to take to ensure I cover the scene from the current focus to infinity
• Knowing where to position for the next focus, when focus bracketing, so there are no focus gaps
• Knowing the best/optimum infinity focus position for a required image quality
Hidden in the above are some real challenges.

For example, as (non-macro) photographers, we are comfortable with the concept of the hyperfocal distance (H). Where H is classically, and simply, written as ((f*f)/(N*C) + f); which, practically we can reduce to (f*f)/(N*C).

Where f is the focal length, N the aperture number and the C the CoC, ie the acceptable ‘out of focusness’, or defocus blur, that we can tolerate. The CoC varies according to the camera being used, the display medium (screen vs print), the size that the image is to be displayed, the distance the viewer is at, and the ‘scrutiny’, ie competition or not.

But where is H measured from?

What is often not said, is that H, and the near and far DoFs that follow from H, are derived from the Thin Lens model and there is hardly a camera in the world that uses such a lens!

Your DSLR or P&S camera certainly doesn’t.

For non-macro photography, modern/real lenses may be modelled as thick versions of the thin lens. With a front principal plane and rear principal plane, ie a lens thickness. For example, see this post for more information: http://photography.grayheron.net/2019/05/splitting-things-apart.html

A classical (symmetrical) thin lens, of course, has a single lens element with the front and rear principal planes located at the centre of the, single, thin lens. But, real lenses are also, usually, not symmetrical, so one should (ideally) also account for the so-called pupillary magnification when estimating DoFs.

‘Luckily’, lens manufacturers help us out a lot, by telling us nothing about the above!!

Thus, we are forced to make use of the thin lens model or modification to it; whether we like it or not.

Fortunately, for most, non-macro, photographers the above lens nuances are irrelevant, as, the distance between the lens zero and H and the sensor (where focus is needed) and H, is small, relative to H. Plus, most photographers know that H is only there to guide them, and they know to add some ‘focus insurance’, eg focus beyond H, never in front of H.

Some, for example portrait or nature photographers, or those wishing to make artistic use of defocused areas in their images, will find the above, more than enough, for their needs. But what if you what to create a sharp, high quality print, covering from ‘near to far’? That is, you are a landscape photographer :-)

If you wished to capture your scene with a single image, you could, of course, seek to increase the DoF by closing down the aperture. But we know this is not a good way to go, as all we are doing is trading defocus blur for diffraction blur; plus, artistically, these two blurs are different.

High diffraction blur everywhere can hardly be called an artistic element of an image! As said above, defocus blur has the potential to help with your artistry, eg helping draw the viewer to certain areas of the image; whereas diffraction ‘softens’ the image everywhere.

The rest of this post is aimed at the reader who knows they want more (practically beneficial use) out of hyperfocal focusing, especially to achieve, so-called, ‘deep focus’: but are unsure how to achieve this.

I have come to call my approach to focusing: ‘output-based focusing’, as opposed to ‘input-based focusing’.

In input-based focusing we select/predetermine the focus, either through calculation, manually via the Live View or through AF, then lock everything down.

With an output-based approach, we additionally seek to dynamically adjust focus, knowing some additional information, to meet the image (output) presentational needs and, as we will see in future post, where necessary, augment focusing, eg through informed focus bracketing.

In this post we will restrict ourselves to a base use case: namely where we wish to maximise the focus quality in the image sharpness, from near to far: to infinity, but not beyond!

Let’s first discuss ‘infinity’. Simply put we can practically define this as when the photographer focuses way into the far field and, when the captured image is reviewed, there is no focus-based difference between that image and one that was taken by focusing farther away.

Ignoring diffraction for now, another way of describing the above is to say that the lens defocus blur has reached a size, such that the viewer can’t discern a difference. From a theoretical perspective we can also sensibly say that, when the defocus blur is less than two sensor pixels, then we have reached that point. This is our (practical/sensible) definition of focus infinity.

[To complete the picture, we should mention, in passing, Rayleigh criterion, Airy disks, diffraction patterns, Bessel Functions and Bayer layers etc! But, ignoring all the science and maths, simply put, all we need to know is that we can’t resolve things that are less than the Airy radius, and pragmatically, for (digital) photographers, this translates to saying, it is pointless seeking (defocus) blurs much less than, say, two of your camera’s sensor pixels].

Of course, at the point of focus, the defocus blur is always zero. As we move away from the focus point, our defocus blur increases, but not symmetrically. This starts to hint at a good place to be, ie between the hyperfocal, where the defocus blur at infinity is the CoC, ie the ‘just acceptable’ defocus point, and the focus position where the infinity blur is around two sensor pixels.

The thing to note here is that this is camera specific. But then again, so is the hyperfocal (H), as it is based on the crop-sensitive, ‘circle of confusion’: which is simply the defocus blur at infinity, when focused at the hyperfocal distance. Thus, knowing H means we really know one of the key pieces of information to allow us to go to an output-based approach to focusing. That is focusing in a more informed way, using output-based, microns of blur, rather than only worrying input distances to ‘focus’ the lens.

To illustrate what this means, in a full frame camera, like my Canon 5D3, this equates to infinity blurs falling between the hyperfocal 30 microns (um) and 2 sensor pixels, ie 12um on my 5D3, and certainly not lower than 6 microns, ie a single pixel. On a crop sensor, you would adjust these numbers according to the camera, eg 30/crop and (1-2)*sensor-pixel-size. Once again, for now, ignoring diffraction.

We also know that if you focus at H, the near DoF will be at H/2 and the far DoF will be at infinity. We also know that if you focus at infinity, the far DoF is, of course, also at infinity; but that the near DoF has now moved to the hyperfocal.

Key point: you cannot obtain acceptable focus at less than your chosen hyperfocal distance, without changing something, ie your acceptable CoC criterion or aperture etc. Or, put another way, always know the hyperfocal distance when doing landscapes, which, as we will see below, is easy.

Thus, adopting an ‘I always focus at infinity’ approach, means that you are throwing away H/2 worth’s of depth of focus in the near field. Which in some situations may be OK: but not in all.

Assuming you are a cautious photographer, you will likely seek out a little ‘focus insurance’ and, rather than try and focus ‘exactly’ at the ‘hypothetical’ H, you will focus slightly beyond this. But where?

As we will see, up to twice H, ie short of the 2*pixel-pitch point, is a good place to settle. For example, focusing at 2*H means the ‘standard’ 30um infinity defocus blur falls to 15um, ie half of that at H.

The ‘convenience’ being that, the only maths you need to do is to know with this approach to focusing, is knowing your hyperfocal and how to double it.

So, let’s look at output-based focusing, making use of a previous post, where I introduced my ‘Rule of Ten’ approach. The original post on RoT that I wrote may be found here: http://photography.grayheron.net/2018/11/infinity-focusing-in-your-head-rule-of.html

But first, let’s remind ourselves of the impact of focusing beyond the hyperfocal.

Ignoring second order effects, the (non-macro) near and far DoFs may be approximated as: NDoF = H*x/(H+x) and FDoF = H*x/(H-x)

Let’s ignore the far DoF, as this is at infinity if we are focusing beyond H, and only look at the near DoF, and ask the question: what have we lost by focusing at 2*H, rather than at H?

The NDoF approximation tells us that when x is 2*H, the NDoF will be at (H*2H)/(H+2H) = 2H/3. That is, we have ‘lost’ H/6 worth of focus, ie (2H/3 – H/2). So, if your hyperfocal is, say, at 1.2m, and you instead focus at 2.4m, all you have lost in the near field is 200mm of depth of field. But, of course, at infinity your focus quality has doubled, ie from the, just acceptable, CoC-based defocus blur to half of that.

Further, we are now seeing where, for the landscape photographer, the (camera-specific) focus sweet spot is; namely, and assuming you are using a sensible aperture, eg F/8-10, between the hyperfocal you are using and where the defocus blur is, say, 2 pixels. So, on my 5D3 this means between H and around 3*H.

Thus, we now have a reasonable infinity focus (starting) strategy, covering us when we focus beyond H and towards infinity. First, know your H, double it and focus there, and check if at 2/3rd of H you are content with the focus cover. Job done!

At this point, many will be saying, OK, but this isn’t much help to me, as: I don’t know where H is; and it’s too complicated for me to calculate it in my head; and I’m not going to muck about with an App on my phone or a calculator: I just want to take pictures!

WARNING: Ignore those that say, focusing at one third into the scene is good enough. This is based on a myth that depth of field is split 2/3 in the far field and 1/3 in the near field. This is only true when focusing at H/3, ie uncomfortably less than H, and we don’t want to be there! Having read this post, you know you can do much better than this!

So, let’s using the ‘Rule of 10’ (RoT) focus distance to progress our ideas.

The RoT states that, at an aperture of F/10, the hyperfocal distance in meters is the focal length, in mm, divided by 10, at a CoC of your focal length.

As an example, assume I’m shooting with a 24-105mm lens at 24mm. I’m at F/10, a reasonable place for a landscape photographer to be on a full frame camera, then my hyperfocal distance is at 2.4m, ie focal length in mm divided by 10 and, at this focus, the CoC will be 24 microns, ie slightly better than the usually used 30um (on a full frame or 30/crop on a crop sensor camera, say, for convenience, 20 on a typical DSLR crop sensor).

Although you can use RoT with any length lens, it really comes into use for those shooting with wide angle lenses, say wider than 30mm on a full frame; and wish to achieve a high-quality focus at infinity and maximise the depth of focus in the near field.

As an example, let’s now assume I’ve switch to my 12mm prime lens and it is set to the RoT aperture, ie F/10.

The RoT distance, in meters, is simply the (focal length in mm)/10 = 12/10, ie the hyperfocal is at 1.2m. At this RoT distance, the RoT CoC is 12 microns, ie the focal length. For high quality work this is about as good as I’m going to get.

But, if I knew I was ‘only’ shooting for on-line/projector display, ie not print scrutiny in a competition, I might think 12 microns is a bit of an overkill, thus I could comfortably ‘back off’ the CoC to, say, 24 microns, ie double the RoT number. So, rather than focus at 1.2m, I move my hyperfocal to 0.6m, ie half of 1.2m. At this adjusted RoT-based H, I know that my near DoF is always half of H (near DoF = H/2), thus giving me a near DoF of 0.6/2 = 0.3m. All done in my head, with no calculators or look-up tables, and all I needed to do was know my focal length and do some doubling or halving of low digit numbers.

I’ll leave the reader to experiment with the output-based RoT approach, as you can use it in many ways to help with your specific focusing needs, including using it to inform artistic-based focusing: but that’s another story, for another time.

As this is the first of several posts I intend to publish on focusing, I’m going to stop at this point, as I think we have achieved a sound, single image, output-based, starting point. In future posts I will discuss using RoT to inform focus bracketing and then we will progress to how the Canon photographer, who uses Magic Lantern or CHDK technology, can make use of my in-camera focusing ‘apps’, ie scripts. For now, I suggest, irrespective of what camera you use, you focus on honing your RoT skills, to always know your hyperfocal ;-)

BTW if you have any questions on the RoT approach, or anything else I’ve said in this post, please feel free to add a comment at the bottom. I will always post a reply ;-)