Wednesday, January 16, 2019

Update of Landscape Bracketing script

Just a short post to say I've updated the CHDK Lua script, that runs on Canon Powershot cameras.

The CHDK post about the script may be read here: https://chdk.wikia.com/wiki/Landscape_Focus_Bracketing_:_perfect_near_to_far_focus_brackets

You may also download the script from: https://gist.github.com/pigeonhill/10a43f5ba543bc758f1ce21d28981a89


Thursday, January 3, 2019

Landscape Focus Bracket Script for the G7X

In this post I'll be talking about my latest 'toy', the Canon Powershot G7X and in particular focus stacking with it.

As we know, macro focus stacking is rather 'easy' to undertake, albeit rather tedious. This is because the near and far depths if field (DoFs), ether side of the point of focus, are virtually symmetrical but very small. 

As soon, however, as we move away from the macro end, the near and far DoFs become progressively non-symmetric, until we reach the hyperfocal point (H), where the near DoF is, of course, H/2 and the far is at 'infinity'. Also the defocus blur field changes through the scene; being zero microns at the point of focus and the 'circle of confusion' set blur at the near and far DoFs.

However, it's relatively simple to estimate (sic) the bracketing that is required. That is, if I'm focused at Sn, where do I focus next (Sn+1) to ensure that my current far DoF is the same as my next near DoF, as illustrated here:


If we didn't explicitly calculate the correct Sn+1 focus position, and, say, only assume a fixed refocus delta, as we do in macro photography, we would end up with 'focus gaps', like this:



As it is near impossible to guarantee that the refocused position is a perfect match, we usually use an overlap 'insurance' to cover ourselves, like this:


With macro focus bracketing, which is usually indoors, we can either make use of rails or even try and move the lens in-camera. But for landscape photography, rails will not really work; plus we also we need to calculate the next focus position.

To date I've tried to solve the in-camera solution by Lua scripting on my EOS 5D3, using Magic Lantern. But I've now given up with that approach, as ML can not (yet) explicitly control the lens, ie drive it to an explicit position. Instead, on my EOS cameras I now use the DoF Bar to give me the required feedback, so I may manually adjust focus to the correct position.

With my 'new' G7X I'm pleased to report that everything just got brighter, as the CHDK environment does allow me to explicitly drive the lens; albeit with a little, but acceptable,  'jitter'.

The script below (a Lua CHDK script I've written that I call Landscape Bracketing) provides three user variables. The first is a simple delay to allow you to trigger the script on the tripod: the default is 3 seconds. The second input is whether you are requesting the script to create a start and end (dark) bookend frame, which helps identify the bracket set in post: the default is yes. The last input is the overlap logic that the script uses: the default is none, ie each bracket will link to the next using the CHDK CoC value. The other two options are 'some' and 'more'. Some will use a overap blur of CoC/1.25 and 'more' will use one of CoC/1.5.

In general the script captures the bracket set from near to just short of H. It then takes two more images: one at H and one at 2H.

As an example, here is a 7 bracket set (screen capture from Lightroom) that the script captured of my test scene:



Here is the near (1st image) showing the narrow DoF at that point:



Here is the last (7th Image), taken at 2*H, which insures our infinity focus quality



Here is the focus stacked image after a round trip to Helicon Focus, showing there are no focus gaps:



The script may be downloaded from the link on the right.

I must say, I'm impressed with the power of the CHDK Lua environment, which provides more functionality than Magic Lantern's Lua; but to be fair we are comparing apples and pears, ie a full frame DSLR to a point and shoot camera. Nevertheless, the G7X represents a great little travel companion for my pocket.

Sunday, December 30, 2018

Some thoughts on focus bracketing with the G7X

Having had a few days to 'play around' with my 'new' G7X, I thought I would start talking about the power that's built into this little marvel, especially when running CHDK.

The basic G7X has limited exposure and focus bracketing and an inbuilt ND filter capability. So, on its own, it's pretty powerful. But add on CHDK and we can take it to to another level.

Canon bracketing is restricted to three brackets: one at the set exposure or focus and one either side of these points. Although you can set the Ev offset for exposure bracketing, with focus bracketing there is no user information to indicate what the focus deltas mean.

Using CHDK, in 'enhanced photo operations', we have access to a great feature called 'Bracketing in Continuous Mode'; which results in CHDK adjusting exposure or focus between the Canon controlled multiple shooting that is accessible via the custom timer. 

Thus we can control up to 10 brackets with CHDK and whether the bracketing sequence is +,++,++... or -,--, ---... or i,+,--,++....

As we know, focus bracketing for landscapes is not the same as that for macro shooting. In macro shooting the depth of field ether side of the point of focus is essential the same and small. In landscape focus bracketing this is not the case. For example, if we take an image at the hyperfocal, H, then if we wish to extend the focus quality either side, we would take a bracket at H/3 and, say, at 2H. See previous posts that illustrate the non-symmeteric nature of landscape focus bracketing, eg:



The above chart hints at a way of focus bracketing without having to write a script. The objective being to achieve the 'best' focus from near to infinity. 

As we know, focusing at the hyperfocal is far from optimal, as, by definition, the hyperfocal is where we just about achieve acceptable focus quality at infinity. Namely, by defining a blur criterion, also called the circle of confusion, we can work out the focus distance that gives this blur at infinity, ie this is our hyperfocal.

The CHDK inbult depth of field and hyperfocal calculations appear to be based on an acceptable CoC that is far from optimal, ie about 30 microns x the G7X crop of 2.7: or about 11 microns. 

We also know that focusing beyond H, although it will give us better focus quality at infinity, will result in loss of near depth of field. In the limit, if we focus at infinity, our near depth of field will be at H; and the blur at H will be the CoC, whereas the blur at infinity will be zero, as it always is at the point of focus.

So if 11 microns is the 'just good enough' value for the G7X, what is the best we can do? Well the G7X pixel pitch is about 2.4microns and for a line pair we need two lines, so the sensible, smallest CoC would be about 5 microns, ie 2 x sensor pitch.

All this ignores diffraction blur, which on the G7X means we shouldn't really go beyond F/5.6. So focus backeting around F/4 to F/5.6 is a sweet spot.

Bringing all this together means that, after experimentation, I ended up with the following approach to achieving landscape focus bracketing on the G7X, without resorting to scripting.

Using the chart above we can see that a four bracket set up, around, H, will gives a quick and simple way of enhancing focus quality. The usual caveat being that our subject shouldn't be moving, well at least not wildly.

I selected F/4 as my working aperture, ie for diffraction reasons, and, using the inbuilt CHDK depth of field on-screen feedback, at the widest focal length, the hyperfocal is indicated to be 1.87m. Giving a near DoF of about 0.9, ie H/2.

But, as we know, the blur at the near and far limits will be about 11 microns, ie only just OK. We also know we can easily half that blur at infinity,bringing it down to about 5 microns by simply focusing at 2H.

For the near field we need to do better than H/2, which is what we get if we focus at H alone. The next bracket down from focusing at H is H/3, which extends the near DoF to H/4.

So now we have the two extremes of our bracket set: one at H/3 and the other at 2H. The difference between these two is 5H/3, which we can divide by 3 to give an estimate of the inter bracket distance, ie 5H/9, just under 2/3 of H. Resulting in the following four focus bracket schema:



So what's the bottom line?

For landscape focus bracketing I recommend focusing on the nearest object of interest, assuming it is less than H, then set the camera to manual focus mode and look at the CHDK DoF info to get the value for H (make sure you do a half shutter press to ensue CHDK refreshes things), take about 2/3 of H and use this as the subject distance in the CHDK focus bracketing variable.

Then in the Canon side set up for 4 continuous images in the custom self timer.

Here are the four test images I just took in our back garden:





And here is the focus stacked image after a round trip from LR to Helicon Focus, plus a little LR tweaking:
So there you have it, landscape focus bracketing informed by CHDK and taken with the help of CHDK, but without any scripting.

The Secret of getting Cheaper and Better Cameras

As readers of my blog know, I love 'hacking' my cameras. For my EOS family, my visible band EOSM, my IR band EOSM, my 'medium format' EOSM and my 5D3, Magic Lantern is, of course, an essential tool. ML gives me RAW control over exposure, enhanced DR via Dual-ISO, automatic bracketing and scripting, eg allowing me to create the DoFBar.

My EOSMs, yes I have three, got me thinking about value when it comes to hardware. These three cameras were all purchased second hand. In fact I got all three for the cost of an original EOSM.

Like many, I think today we are overly encouraged by manufactures of our TVs, phones or cameras, to 'upgrade' to the latest and best technology. But, in doing this I feel we may be missing a 'value' trick: that is, rather than upgrade, why not consider 'downgrading'.

The reason the 'downgrade' option works is that previous versions of our cameras are still very good. So rather than rush out to get the latest, think about looking backwards: which is what I did over Christmas.

At the moment my pocket camera is a Canon Powershot S95, hacked, of course, with CHDK. It's OK, but it has a very small (1/1.7") sensor, as can be seen in this chart:

This got me thinking. I looked on the CHDK site to see what was the largest Powershot camera that could run CHDK. Which lead me to the G7X. You can pick up the latest G7X, the Mk 2 for about GBP430 in the UK, but it doesn't run CHDK (yet). But the Mk 1, with the same (1" Sony) sensor, goes for half of that on eBay.

BTW the term 1" sensor is misleading, as this does not refer to the sensor's physical size. The term being a legacy from the old vacuum tube days; but that's another story.

So my Christmas present to myself was a secondhand camera: a Powershot G7X.


The camera has the advantage of a tilting screen, which is great for low level shots. As the Canon website says: "The PowerShot G7 X is a premium high-performance camera that puts exciting and impressive capabilities in a sophisticated, compact package. It starts with the sensor: a large and light-grabbing 1.0-inch, 20.2 Megapixel High-Sensitivity CMOS sensor powered by Canon's latest generation DIGIC 6 Image Processor for beautifully rendered low-light photography up to ISO 12800. The IS lens is a f/1.8 (W)-f/2.8 (T) that puts more in your frame while staying bright to the maximum 4.2x Optical Zoom (24mm-100mm), with a 9-blade circular aperture diaphragm for artistic background blur, and a minimum focus range of just 5cm for precise macro shooting. Wi-Fi® and NFC-enabled, the PowerShot G7 X is selfie-ready with a high-resolution multi-angle capacitive 3.0-inch touch panel LCD. Shooting is a joy with High-Speed AF (0.14 sec.), 31 AF points, full-resolution continuous shooting up to 6.5 fps and 1080p/60p HD video." 

As soon as I got the G7X I loaded CHDK, after confirming I had the rev d canon firmware. I then tested my likely top feature in CHDK, namely bracketing, which worked perfectly.

I'll write about the G7X and CHDK in future posts: for now I'll leave the reader reflecting on my 'downsizing' thoughts. That is getting (great) value for less, by looking backwards!

 

Sunday, December 9, 2018

DoF Bar: Simple Focus Bracketing

In this post we will look at how DoF Bar can help you get perfect in-camera focus bracket sets. In the next post we will look at more advanced focus bracketing, but for now we will keep it simple. The DoF Bar settings for the simplest bracketing looks like this:


Here we see that the minimum focus has been set to the minimum DoF distance that we can achieve with the 24mm lens we are using at F/8, ie 390mm. We also have selected ‘Brackets to H’ in Pro Mode, as this will tell how many focus brackets we will need to take.

After composing the scene, in this case a really exciting image of my dinning table, we position the lens to as far as it will go to the macro end. Note that we can focus bracket in both directions, but in this post we will show the process near to far. The LV screen now looks like this:


DoF Bar is telling us that we will need at least 4 brackets to cover from where we are to the hyperfocal. As this will ‘only’ get of far DoF to the hyperfocal, we will usually take an additional image in the infinity focusing zone, ie H-4H, using the DoF Bar infinity blur feedback to inform our choice.

Note: the bracket to H information dynamically updates as you change focus.

We down take our first focus bracket, covering a DoF of 39-52cm, as shown below. DoF Bar also tells us that the lens defocus blur, at the DoFs, is 28microns.


As we haven’t moved to the next focus point yet, the top, showing the last image captured, mirrors the current focus conditions.

Let’s now focus away from the macro end and use the DoF Bar feedback to tell us when to stop. Remember we are looking to get the current near DoF as close as we can to the last image captured far DoF. To help us, DoF Bar flags up when we have over focused, ie the current near DoF would turn blue.


Here we see we have achieved the best conditions for the next bracket, with the current near DoF just short of the last far DoF. The current DoF now covers 52-80cm.

We now repeat the above until we are at the third focus bracket:


Here we see the current DoF covers 77cm to 1.71m. The final bracket, number 4, being this one:


Here we see that the current near DoF is 1.58m, ie less than the last far DoF of 1.71m, and that because we are focusing past the hyperfocal, our current far DoF is providing us with blur information, namely: we have an infinity defocus blur of 19microns, a diffraction blur of 10microns, giving a total blur of 21microns.

As we are seeking a near to infinity tack-sharp image, it would be prudent to take a final image to maximise the far field’s focus. DoF Bar helping getting us to this situation:


Here we see we have reduced the total blur to 14microns and the defocus and diffraction blurs are nearly the same.

We now have five focus brackets that need post processing. In this case, I also had Dual-ISO switched on, so the first step, after ingesting into Lightroom, was to process the Dual-ISOs arriving at these five images, clearly showing that, at F/8, we could not cover the full depth of field:

Macro End: 1st Image


2nd Image


3rd Image


4th Image


Infinity Focused Image

These images now need to be focused stacked, using your preferred approach. In this case I did a round trip to Helicon Focus, arriving at this ‘final’ image, ie I haven’t really bothered with any post processing beyond the basics.


In this post we have shown how DoF Bar can give you perfect focus brackets, near to far. A tack sharp image from the closest focus you can achieve on a 24mm at F/8, ie about 39cm, to a far infinity focus generating a total blur of 14microns, ie double the quality of an image taken at the hyperfocal.

In future posts I’ll provide further insights into DoF Bar.




Saturday, December 8, 2018

DoF Bar: Getting Started

In this post, and in future ones, I'll provide some examples of using the DoF Bar; but before doing so, let’s remind ourselves what DoF Bar looks like if we are ‘simply’ using it to provide DoF feedback associated with the single image we are attempting to take.


The DoF Bar menu looks like this. Here, in this example, 'Show Bar' is ON, if it was 'OFF', DoF Bar would be hidden in LV; The minimum focus is set at 700mm; Bracketing of set to OFF; and Pro Mode (not discussed in this post) is set to Blurs. Finally, the the dynamic bar option is set to DoF (my preferred option).

DoF Bar provides focus information in two formats. First, the near and far depth of field distances. Secondly, infomation about the blurs at the DoFs. There are three types of blur that DoF Bar reports:

  • Lens generated defocus blur (f)
  • Aperture generated diffraction blur (d)
  • Total blur calculated from the RMS of the f and d above (t)
In addition, DoF Bar provides additional blur information associated with 'infinity focusing', ie focusing beyond H and less than the Canon reported infinity. When infinity focusing, the far (sic) DoF blur becomes less than that which is active when you are focusing at less than H.

Thus, if you see an ‘i’ in front an ‘f’, ie ‘if’, you know that blur refers to the infinity state.

To illustrate how to use DoF Bar, the use case we will look at in this post, is how to set focus for maximum depth of field and (sic) best image quality.

First, as we are seeking best image quality we need to be sensitive to diffraction, so we will switch that on in the ML Focus Menu. In this case, we will use the 'normally accepted' full frame total blur criterion of 30microns and we will switch on diffraction aware.
 


We also note that an lens’s overall quality varies as we increase aperture; and many photographers recognise there is a sweet spot about (sic) a couple of stops down from the lens’s widest aperture. For example see https://www.cambridgeincolour.com/tutorials/lens-quality-mtf-resolution.htm.

To illustrate how we may use DoF Bar, let’s look at a 24mm lens, set to its widest aperture, and focused short of its hyperfocal (H). The Live View will look something like this:
 


Here we see we are at an aperture of F/5.6 and that DoF Bar is reporting a near DoF distance of 69cm with a (de)focus blur of 29microns, and a far DoF distance of 1.06m with a total blur of 30microns, as one would expect, as we have set 30microns as our criterion in ML. ML is also reporting (bottom bar) that the focus is at 84cm. 


Note that if we are focused short of the hyperfocal distance, the end of the green bar, then, by definition, the blurs at the near and far DoFs are the same. Thus although the near DoF above is reporting 29microns of defocus blur, this is the same at the far DoF. Likewise, the total blur of 30microns at the far DoF, is the same at the near DoF.

Let’s now refocus towards infinity and stop when the far DoF just goes past the hyperfocal.

BTW the hyperfocal and other info may be seen in the ML Focus menu, eg: ML info in menu we see reported that, at this aperture, the diffraction blur is 7microns; and that the hyperfocal is at 3.59m: 



After refocusing the LV now looks like this:
 


Now we see the DoF Bar format has changed, with two additional bars coming into play. The left hand one being a visual aid, set by the user as the min focus, ie 700mm in this case. The right had bar is sub-divided into three zones, covering H-2H, 2H-3H and 3H-4H. In this example the near DoF has moved to 1.35m, the far DoF at 4.97m and the focus at 2.11m. The blurs, of course, have not changed.
 

Lets now continue focusing, to just beyond H and shut our aperture down to a more sensible F/11.
 


Here we see at a focus of 3.86m, the DoF Bar is report the near DoF distance as 1.34m, with a focus blur of 26microns now as we have changed the aperture, and, as we are at/beyond the hyperfocal, DoF Bar now switches from showing the far DoF distance, which is infinity, to showing us infinity blur information, ie the blur at infinity. The additional information we see is that the infinity focus blur has dropped to 14microns, the diffraction is at 15microns and the total blur is 20microns. Thus the far quality of focus is now better than at the near DoF, where the total is, of course, still 30microns.

We also see the text colour has changed from green (not shown) to yellow, warning us that the diffraction blur is larger than the defocus blur.

Without DoF Bar we simply would not be aware of this additional focusing information; as once we have gone past the hyperfocal distance, ML provides us no additional information, other than the focus distance. But we know that, as our focus approaches infinity, the defocus blur of the lens reduces to zero, at infinity. That is, once past the hyperfocal distance, the focus quality between the focus point and infinity, keeps getting better.

But, as we know, if we focus at infinity, the near DoF is at the hyperfocal distance. So, once we have achieved the required focus quality, there is little point keep focusing towards infinity, as you are losing near DoF. Or put another way, the near DoF, from the hyperfocal distance (H) to infinity, reduces from H/2 to H: thus if your near DoF needs are meet by a near DoF of H, then you can safely focus towards or ‘at’ infinity.

But what is you need to maximise the near depth of field? What should you do?

Most photographer will approach the above by decreasing the size of the aperture, knowing that doing this will, and ignoring diffraction, increase their DoF, ie make their near DoF as close to the camera as possible. So let’s do that. Let’s leave focus where we are and simply keep shutting the aperture down.

BTW if the infinity blur information turns red, then we are focusing beyond 4*H and are likely seeking defocus blurs smaller than is sensible with the sensor, ie less than two sensor wide.
 


The near DoF is now at 1.23m and the defocs blur at the near DoF is 21microns. We also note the diffraction blur is 21microns, the defocus (infinity) blur is 10microns and the total blur is now 23microns.

But, as an experiment, let’s carry on closing down the aperture to its smallest, eg F/19 and F/22. We now see this on the LV screen:
 



At F/22, there is no solution, and at F/19 the near DoF is at 1.39 at a defocus blur of 14microns, ie we have lost depth of field because, of course, diffraction is beating us. Also the total infinity blur is now up to 27microns. Remember that ‘focus quality’ is a root mean square addition of the lens defocus blur and diffraction blur.

So it looks like that F/11 was best for gaining the most near DoF and getting the infinity blur as low as possible.
 

Thus, at a focus distance of 5.24m and at an aperture of F/11, the near DoF, which meets our ML set criterion, is 1.47m, and the overall blur at infinity is 18microns. Knowing that ‘best’ lens quality will be found at around F/11, means this is a good place to finish focusing.

Hopefully this quick introduction to DoF Bar has provided sufficient information to allow others to experiment with focusing by blurs. In future posts I’ll provide insight into one of the main features of DoF Bar, namely focus bracketing.

Tuesday, November 27, 2018

DoF Bar: Background

In past posts I’ve talked about focus and introduced two tools that help you make informed decisions about focusing, namely: The Rule of Ten (ROT) and the (Canon EOS only) Depth of Field Bar (DoF Bar).

In this post, and a subsequent one (Part 2), I hope to persuade readers why using these two tools, especially the camera-agnostic ROT, is a good idea.

My reason for the tutorial is simple: some have told me they don’t understand what I’ve previously written!

Now that could be 100% down to me and how I write; or, as I prefer to believe, a bit of me and bit of a lack of knowledge in the reader about using blurs to optimise focus.

What follows in this post, ie Part 1, is a reminder on the basics of focus, which is essential to know if you are going to get the best out of the two tools mentioned above.

So what is Focus?

At its simplest focus is subjective and related to the viewing conditions. For example, one person, with a visual acuity of X, looks at a print and sees everything ‘in focus’; whereas, another person, with better eye sight, looking at the same image might see a sight softness in places. Then both look at the same image on a Facebook page and, magically, the image is in focus everywhere, for both of them.

As photographers have considered focus for over a hundred years, we now have ‘accepted standards’ when we talk of ‘sharpness’ or ‘focus’. One of the recognised ways of discussing depth of field assumes (mixing units) an enlargement to 8 x 10 inches, at a viewing distance of 10 inches, and a normal visual acuity of about 5 (black and white) line pairs per mm (lp/mm) at that viewing distance.

We then use this 5 lp/mm, or 0.2mm for 1 lp, on a print, to estimate an acceptable blur, which is often called the circle of confusion (CoC), on the sensor. A recognised estimate being:



If we now assume a full frame sensor, ie 36mm x 24mm, the above becomes:



The above resulting in the oft reported CoC of 29 microns for a full frame camera.

As we can see from the above, if the viewer was not looking at an 8 x 10 inch print at 10 inches, then the CoC would change. For example, viewing a large bill board at 20 feet away vs viewing a Facebook image on a phone screen.

This leads to the first guidance on focusing that I would offer, namely, unless you really know the final viewing size and conditions, stick with the standard CoC guidance. For shear convivence, I personally use 30 microns on a full frame and 20 microns on a crop sensor, as my base CoCs: that is acceptable focus quality; as they are also easy numbers to remember.

Rather than keep saying CoC , I find it more convenient to call the CoC a blur; and recognise that the total blur is made of two main components: the lens defocus blur and the diffraction blur; and without proof, it is usual to discuss these three blurs in the following way:



Lenses, of course, are complex mechanisms and far too complex to handle without a great deal of mathematics and computer modelling. Thus, for convenience, photographers resort to making use of a simple model of the lens, that allows us to estimate the focus field in front of and behind the point of focus. These simple equations are really only suited for non-macro photography, eg landscape photography.

Before looking at a little more maths, let’s look at a what a typical lens defocus field looks like. The horizontal axis is the distance from the lens (ie approximately the camera) and the vertical axis measures the defocus blur, with the defocus blur criterion, in this plot, being set at 30 microns.



Here we see the classical shape of the defocus blur. The in-focus portion is where the blur is less than our 30 microns. These two distances, near and far, are thus our near and far depths of field.

We also begin to see that, the focus in front of the point of focus, does not equal the focus behind the point of focus. The two extremes being:

· As the point of focus approaches the lens minimum, ie macro shooting, the focus in front and behind collapses towards being the same.

· There is a distance where the far depth of field is the same as our criterion (30 microns here) and, at this point, the near depth of field is half of the focus. This point is called the hyperfocal distance or H.

Once again, for pragmatic reasons, and assuming we are not doing macro photography, we can make further simplifying assumptions that lead to the hyperfocal distance being estimated from the following:



Where f is the focal length and N the aperture number; and where the defocus blur can be found from:



Now the diffraction blur, in microns, can be estimated from:



Where k is 1.34, for normal visible, ie not IR, photography: thus, at an aperture of F/10, the diffraction blur may be estimated at just over 13 microns.

BTW, F/8-F/11 is recognised a sweet spot for a lens in general, ie overall image capture quality.

The above simple equations now give us everything we need to estimate H and account for diffraction; and if we focus at H we get the following result, with an infinity blur of the defocus criterion:



As an example, let’s take our 30mm lens at F/10 and work out H to meet a total (sic) blur of 30 microns. First, the diffraction blur we know is 13.4 microns. Plugging this into the above gives the following:



Which equals 26.8 microns, which we now plug into the equation for H, converting 26.8 microns into mm, to get:



Which gives a diffraction informed hyperfocal distance of 3.35m, which may be compared to the hyperfocal if we did not account for diffraction, which would have been 3m, ie:



Using the ROT to make it simple

The above, although a simplification, is still not that easy to calculate in your head, which is why most revert to Apps or look-up tables, or guess the hyperfocal.

We can, however, greatly simply things by using the Rule of 10, which simply says set the defocus blur to the focal length (f) in microns, ie:



And if we set N to F/10, we have a very simple way of estimating H, in meters, in our heads, ie HROT = f/10.

Thus, in our example above, ie a 30mm lens used at F/10, using the ROT we note that this will be at a defocus blur of 30 microns, ie focal length in microns, H will be 3m.

But let’s say we wish to achieve a higher quality print with a defocus blur, say, of 15 microns; then, using our ROT all we need to do is factor the ROT H by a factor of 2, ie 30/15. Thus, if we focus at 6m, this becomes our new H, but with a defocus blur criterion now of 15 microns.

But what if we weren’t using a 30mm lens? Once again, the ROT approach allows us to quickly calculate where we should focus. As an example, let’s choose a 15mm lens set at F/10 and seek out H at a defocus blur criterion of 30 microns.

Using the ROT methodology, we would focus at 15/10 = 1.5m, but of course this means our defocus blur is the focal length in microns, ie 15 microns, whereas we are seeking H at 30 microns, which is twice the ROT number. So all we need do is focus at half of H, or 0.75m.

Once you get the ROT approach in your head, it is a very simple matter to estimate defocus based hyperfocal distance, H.

As a recap, here is the ROT:



But why are blurs and H so important?

Knowing your defocus blur, and thus H, means you are in full control of focusing information. Also, by being sensible with aperture, ie setting it to 10 or there about, means you are not letting diffraction beat you. Thus, pragmatically, at F/10, you can ignore diffraction and simply use the ROT-informed H. As shown above, if we ignore diffraction the total blur is only made up of the defocus blur, say, at 30 microns, and if we include F/10 based diffraction, the defocus blur only reduces to about 27 microns.

Thus we can safety use the ROT approach without worrying about diffraction, as long as we focus a little beyond H. Certainly 2*H, ie a defocus blur of 15 microns for a 30mm lens using the ROT approach, is well beyond a ‘little beyond H’.

In general, H based focusing looks like this:


Here we see if you focus as H, your near depth of field will be H/2; and if that is not sufficient, all you need to do is refocus at the odd fractions of H, ie H/3, H/5 etc until you have covered your required depth of field needs. Your near and far depths of field at these new points of focus simply become the even fractions either side of the odd fraction. Thus if you focus at H/9, the near and far depths of field will be at H/10 and H/8.

In addition, as you focus towards infinity and away from H, you can simply dial in the infinity blur that you wish to use. Thus at 2H, the infinity blur will be half of that at H.

BTW the above also shows us that the often repeated advice that focus is one third in front and two thirds behind the point of focus, is only true when the focus is H/3.

Pragmatically, five focus brackets is most probably a sensible lower limit, which we now know will extend your near depth of field from H/2, that a single image gives you, to H/10.

Bottom line

In this post we have reminded ourselves that focus is really the ‘zone of acceptable out of focusness’, based on reasonable assumptions about viewing distance and eyesight. We also recognise that the total blurriness in an image is made up of the lens out of focus and a contribution from diffraction.

In order for diffraction not to become an issue, and to maximise image quality, F/10 is a good place to be capturing images.

Also, by using F/10, we can make use of a very simple rule (Rule of 10) to find the hyperfocal distance, H. That is H, in meters, is the focal length in mm divided by 10 (or in general N), generating an infinity defocus blur of the focal length in microns.

Finally, knowing this focal length informed H, we can estimate any near and far depth of field; and undertake focus bracketing, ie by focusing at the odd fractional parts of H.

In the next post, now that we know all about blurs and the power of knowing the hyperfocal, I’ll discuss how to make use of the Depth of Field Bar that runs under Magic Lantern.