Monday, May 15, 2017

FOCUS Tutorial



With the first (full) release of my new FOcus COmpanion Script (FOCUS, downloadable on the right), I thought I would write a short tutorial on one of the use cases, namely landscape focusing.

Before doing so, it is worth highlighting the core functionality of FOCUS:

  • It runs within the Magic Lantern Lua environment;
  • It runs continuously, unless you switch it off;
  • By default it is enabled in DoF (depth of field) mode, which we will discuss below;
  • The other modes are interactive mode, which allows you to direct the lens to the hyperfocal distance point, with various aperture options (we will cover this in a later tutorial); and a mode that provides more infinity focus info.

Before discussing how to use FOCUS, it is worth a reminder as to why focusing is not as easy as one would think.

First, modern AF lenses are great at what they do: auto focus. However, when it comes to manual focus, these lenses can be a challenge, eg no hard stop at infinity (to cover glass temperature variations and IR focusing) and, more importantly, very poor correlation between the lens markings and focusing distance, especially when you approach infinity, which, on a wide angle lens, favoured by landscape photographers, is not that far into the field.

Luckily, most modern lenses, even if they are not auto focus, report focus distance, which Magic Lantern gives us on screen and access to in Lua: in addition to aperture and focal length etc. In other words we have all the properties we need to do some interesting stuff.

Another reason that lenses are not ‘easy’ to focus is that their response is not linear. To see this all you need to look at is the focus info on the lens. For example, an x degree rotation of the lens at the macro end is not the same as an x rotation towards the infinity end.

Finally, the depth of field of a lens, ie the zone that to our eyes appears ‘sharp’ is not a simple function through the scene. For instance this chart shows a 24mm lens at F/8 focused at the hyperfocal distance. The green curve show the effect of diffraction, while the blue curve is ‘just’ the optical response. Unity is where the blur is just at our selected acceptable limit, ie around 30 microns here.



Around the plane of focus the difference is clear to see.  In the far field the curves asymptotically approach our set limit, 30 microns in this case; whereas in the near field’, focus collapses rather quicker and towards infinity blur. 

The above curve illustrates a key property of (non-macro) lenses, ie the near and far field responses are radically different: in a true macro lens the near and far depths of field are very small and ‘symmetrical’ about the plane of focus.

So how does the above insight and access to FOCUS help us?

The ‘secret’ of getting the sharpest landscape images, ie from the near to infinity, is to not (sic) use the hyperfocal distance, as, by definition, at infinity the focus is only just acceptable. See my previous posts for more information on HFD vs infinity focusing.

FOCUS brings you a new way to do landscape focusing, through access to three pieces of information: the total blur at infinity, a visual feedback on the optical focus field, ie without diffraction, and the 'usual ML' information about the near and far depths of field with diffraction.

OK, I appreciate some of you may have stopped reading, so lets show the Live View screen when FOCUS is running in its DOF mode.



Here we see the focus bar from FOCUS and, because we are in DOF mode, the left and right hand edges of the focus bar show the near and far depth of field points, ie the green dots (note the distances (within rounding limits) are the same as ML is reporting at the bottom). 

The red dot is the plane of focus, clearly illustrating the bias towards the near field. The focus bar shows the blur as it varies from 0 (white), at the plane of focus, to the ML set total acceptable blur (black), or Circle of Confusion if you prefer.

Clearly the above, random, starting position is not much good for our landscape, so let’s focus towards infinity until we see ML reporting that the far DoF is at infinity. 

The following image shows that we are at now at the HFD, a distance on 71cm, as ML is reporting the far DoF at infinity: as is the focus bar, which is telling us that the total blur is in fact around 28 microns, ie we have (manually) slightly ‘over focused’.



The key thing to note is that throughout the focus field, the acceptable focus is virtually fixed, ie the same level of grey (note the focus bar only shows optical focus blur, ie not diffraction). In this case black equals 30 microns. A total blur of 30 microns would be OK for screen representation, but not for high quality printing, where you would like to see a total blur of, say, half this.

But remember, although we are at the hyperfocal distance, we are in fact only focusing at about 71cm! What if we carried on, say, to the lowest total blur that we can get at infinity. This image next shows that state.



We have now moved focus to 4.25m and the total blur is reported as 12 microns. This is practically the lowest we can achieve with a 5D3, ie below this we are ‘breaching’ the 2xsensor limit, as the 5D3 sensor pitch is about 6.3 microns. Also note the focus bar greyness has shifted towards white, indicating that the optical blur across the field is about as low as you can get it.

So what have we gained by focusing beyond the HFD?

Well we have achieved about double the ‘total focus quality’, ie 12 microns vs 30 microns; which equates to doubling the print (lp/mm) quality. But what have we lost?

In this case, with a 12mm focal length, the acceptable near depth of field has reduced from 34cm at the HFD, to 1.1m using the infinity blur focusing approach. 

Note: the left hand of the focus bar reports the total (optical & diffraction) near depth of field if the far depth of field is less than infinity, ie at the HFD. Once the far depth of field is greater than infinity, the left hand end of the focus bar reports the depth of field that meets the infinity total blur, ie which will be different to the ML reported near DoF (1.1mm vs 55cm in the above example, ie the ML DoFs use the ML set total blur criterion, eg 30 microns in this example.

Clearly it is up to you to decide whether the above is acceptable, eg near field depth of field. But note you have a lot of information to use, eg:

  • A total blur at infinity of 12 microns, as good as you can hope to get;
  • A near DoF, based on 12 microns, of 1.1m;
  • A near DoF, based on 30 microns, of 55cm.

So let’s sum up.

With the new FOCUS approach to focusing we have the advantage of visually ‘seeing’ the focus field, as well as gaining access to some critical information at infinity. These new pieces of information, together with the ML supplied info, represents a new and enhanced way to control focus in your images.

In future posts I will provide more ‘case studies’ related to FOCUS, as well as illustrating additional functionality.

I hope you find this new approach as useful as I have; and, as usual, I welcome any feedback.

1 comment:

  1. Hi Garry

    I have a 6D, 7D and and EOSM so will try it on these. I seem to remember that the EOSM LUA does not support control of the lens... is that still the case? Even if not it should still be useful as an indicator.

    ReplyDelete