Sunday, November 17, 2024

Focus Bracketing: An Integrated Perspective

In previous posts I've discussed focus bracketing models from both the object and image side of the lens. In this post I'll bring together both perspectives and show they are essentially the same.

Before going into the details, I have to admit an error crept into my first post in this series, about focus bracketing, that I've now corrected.

Also, up until now I've constructed my object side model by assuming focus bracketing takes place from the hyperfocal, thus requiring an additional bracket to be added to account for a focus bracket at infinity. In this post, I'll assume the object side focus, hyperfocal bracketing model, starts at infinity:

In the above we see that the first focus bracket is at H/0, ie infinity, and the last bracket, ie the nearest to the camera, is placed at H/(2(n-1)). Thus if the last bracket was, say, the 5th, that bracket would be taken at H/8. Noting that x, the nearest focus distance, is measured from the front principal which, in this model, is also the entrance pupil, as we are ignoring pupil magnification.

To estimate the number of brackets, all we need to do is solve x = H/(2(n-1)), for n.

We thus end up with the simple insight that the number of brackets, ie images to be taken, can be estimated from (H/(2x) + 1).

If we now substitute the approximation for H, (f*f)/(N*C), ie dropping the single focal length term, we end up with the number of brackets (n) being given by:

To appreciate the image and objective side perspectives, we can now layout the two models, side by side:

As previously discussed, from the image side perspective, the number of brackets can be estimated by dividing the total depth of focus at infinity (2NC) into the lens extension at the nearest focus of interest and adding one, to account for the fact we are starting at infinity or at the minimum focus distance (MFD). If we take the extreme focus to be the MFD, the lens extension is simply the focal length (f) times the magnification (M) at the MFD. Which gives us an estimate of the maximum number of brackets, from the image side perspective, of:

These two models are virtually the same for lenses, when the focal length is small relative to the focus distance, where we can approximate magnification as f/x, rather than use f/(x-f). 

Clearly, the simplest model to use to explore auto focus bracketing, is that from the image side, eg the overlap circle of confusion being estimated from:

As an example, let's say we wish to estimate the circle of confusion (C) for an auto bracketing step size of 4. All we need to do is set the camera to the focal length of interest (if it is a zoom), set the aperture, and either measure or accept the manufacturer's stated magnification at the MFD; and then focus at the MFD and take a bracket set, even with the lens cap on.

Let's say the focal length was 22mm, the aperture was set to f/11, that the magnification at the MFD was 0.3 and that 16 images were captured.

Plugging these numbers into (f.M)/(2.N.(n-1)) gives us an estimated overlap circle of confusion of 20 microns.

It’s as simple as that.

As usual I welcome any comments on this post or any of my posts.







Saturday, November 9, 2024

Another look at focus bracketing

In recent posts I've explored deep focus bracketing, for example for landscapes, where we wish to capture focus brackets from the minimum focus distance to infinity, using a simple object side hyperfocal based model:


In this post I'll shift my attention to the image side, where things get a lot simpler:

The focal length at distances less than infinity is given by (1+m).F, which is measured from the rear principal. BTW the illustration above is not to scale, it is just to show the concept of using the depth of focus, ie 2.D.

The above image side illustration showing that the lens extension is given by the magnification (m) times the focal length (F). Thus at infinity, where m is approaching zero, we see that the active focal length is simply the manufactuer's quoted focal length, ie as printed on the lens, but at the minimum focus distance (MFD) the active focal length is (1+M).F, where M is the maximum magnification, ie at the MFD.

Using the above, and similar triangles, and noting that C is very much smaller than the aperture, it is easy to show that the ‘near and far’, or front and rear, depth of focus (D)ie not the near and far depth of field which is quoted on the object side, is approximated  by (1+m).C.N, where C is the overlap circle of confusion we wish to use and N is the manufacturer's (infinity) aperture number, ie as quoted on the lens.

From the above we can see that the depth of focus, either side of the point of focus, varies according to the magnification but is independent of the focal length, and that the smallest total depth of focus, ie at infinity, is simply 2.C.N

We can therefore estimate the maximum number of equal lens rotations we need to make, to go from the MFD to infinity, by simply dividing the lens extension (M.F) by 2.C.N, which gives us a very linear appreciation of the maximum number of brackets that could get taken, ie as we have ignored changes in magnification as we focus. Or, put another way, we have introduced some 'focus overlap insurance' by not ‘worrying’ about the depth of focus varying as we adjust focus; which is not a bad assumption when doing non-macro focus bracketing, where the maximum magnification will be low.

To illustrate how we may use the above, let's assume we are using a Nikon 18mm f/2.8 lens, and we wish to manually focus bracket from the MFD to infinity.

The only thing we need to know is the magnification at the MFD, which, as this is a prime lens, we can take from the manufacturer's data sheet, or from PhotonsToPhotos or capture an image of known size, in focus, at the MFD and measure M in Photoshop. The reproduction ratio being quoted as 1:9.1, ie at the MFD, gives an M of 0.11:

We now have all the information we need to estimate the number of brackets to take at, say, an overlap circle of confusion of 20 microns and an aperture of f/10: (M.F)/(2.C.N) = (0.11*18)/(2*0.02*10), which is say 5. It is a simple matter to then use the manual focus bracketing hack that is discussed in the previous post.

To illustrate the advantage of 'going wide', let's look at another lens: an Irix 11mm lens.


Here we see the magnification at the MFD is given as 1:7.68, ie M = 0.13. 

Keeping the CoC at 20 microns and the aperture at f/10, we now arrive at (M.F)/(2.C.N) = (0.13*11)/(2*0.02*10), ie say 4.

Finally, to show why manually focus bracketing a telephoto lens is a bad idea, let’s take a Canon 200mm f/2.8, with a maximum magnification at the MFD of 0.155. In this case, the number of brackets, keeping everything else the same as before, is some 77. Well, good luck with that ;-)

Of course, looking at focus bracketing from the image side is not a new idea, for example see here for an insight into auto focus bracketing, looked at from the image side. However, the above is how I have rationalised manual focus bracketing wide angle lenses from an image side perspective.

The bottom line being: estimating the number of focus brackets, or more correctly the most you need to take, is greatly simplified by considering the image side of the lens and ignoring focus to focus changes in magnification. The final caveat being that, like looking at focus bracketing from the object side, the above image side view is just a model, but one that, hopefully, gives the reader greater appreciation of how focus bracketing works.

As usual I welcome any comments on this post or any of my posts.


 

Friday, November 1, 2024

Focus by wire warning: not for manual focus bracketing

In previous posts I've shown how you can 'calibrate' your in-camera focus bracketing, such that you can set the focus step in terms of the overlap optical blur that you wish to use: Part 1.

But what if you don't have a camera with an in-built focus bracketing feature, for example my EOS M3. Can you still focus bracket?

The answer is clearly yes, but we need to be aware of a lens limitation: namely, the lens can't be a pure focus by wire type.

To understand why this is the case, we first need to appreciate how a 'normal' lens works. 

As we know, a modern lens is composed of many lens elements and some of these need to move relative to each other as we focus, say with a prime lens. Things get more complicated if we consider a zoom lens, ie more lens elements need to move relative to each other.

Since the early days of complex lenses, manufacturers have made use of a so-called helicoid mechanism:

In the above, taken from this lens rental post, we see the helicoid component, converts lens barrel rotation (focus or zoom) into axial lens movements. The key take away here is that there is a mechanical, which can be manually or electrically driven when using AF, relationship between lens rotation and axial lens element movement. 

In addition, such a design will exhibit hard stops at the minimum focus distance and at infinity, although on some lenses they may 'focus beyond infinity', ie going out of focus beyond the optical infinity, until the helicoid infinity hard stop is reached.

In a previous post I showed how one can add a depth of field scale to any lens.

An alternative way of looking at this is to use the simple expression (k+3)/2. Where k is the ratio of the short hyperfocal distance, ie (f*f)/(NC), divided by, say, the minimum focus distance, as measured from the front/entrance pupil, ie the no parallax point of the lens; as shown here (from Photons to Photos) for an EFM 11-22mm lens, at 11mm, ie in blue:

The (k+3)/2 expression then gives the number of brackets to take to cover from the (minimum) focus distance to infinity. Once we have k, we can then simply put some gaffers or masking tape around the lens, mark the minimum focus distance and infinity focus points, then divide that distance up, to create k tick marks, eg using Thales Theorem. The tick marks giving us the perfect locations for focus bracketing:

The downside of the above is that it is only good for one focus length, which is not a problem with a prime, or with a zoom, when you focus bracket at, say, the short end. It is also limited to a single aperture value and one circle of confusion value. Once again not a problem if you are shooting landscapes, eg, say, at f/10 and with a CoC of 15 microns on a full frame camera.

But what about if you have a focus by wire lens, such as the EFM 11-22mm (shown above).

Will our gaffers tape hack work?

The answer is no: as such lenses decouple the focus rotation from the lens movement. That is, the lens senses the focus ring being rotated and then electronically instructs the lens mechanism to move.

The issue is not that there are no hard stops, as you can work around this; the issue is that the lens will move focus in a variable way, according to the focus ring rotation speed. Although some focus by wire lenses allow you to switch the lens into, so-called, linear mode, where the lens behaves more like a helicoid lens, where rotation of the focus barrel is speed invariant in moving focus.

Although I don't like to say, never; in this case, from my experience, I can never guarantee to rotate the lens at the same speed each time, thus you may find that rotating the lens barrel does not move the lens elements in the controlled way it does with a helicoid mechanism lens.

So, the bottom line is: forget manual focus bracketing with a pure focus by wire lens, although a focus by wire lens that can be switched to so-called linear mode, to make focusing rotation speed invariant, could still use the masking tape hack.

As usual I welcome any comments on this post or any of my posts.

 

 

Saturday, June 22, 2024

In-Camera Focus Bracketing Demystified: Part 3, telephoto bracketing

In part one of these posts, directed at demystifying in-camera focus bracketing, I introduced a hyperfocal based model that allows us to reinterpret the camera manufacturer’s focus bracketing 'quality' variable, from 1 to 10, in terms of the overlap circle of confusion (CoC) or optical blur.

In part two I extended the model to estimate the focus bracketing in the macro region, where one needs to account for optical and pupil magnifaction.

In this third part of the focus bracketing story, I'll have a look at telephoto lenses and show why one needs to be wary about focus bracketing at long focal lengths.

As a reminder, ignoring optical and pupil magnification, the basic equation to estimate the number of images to take, to non-macro focus bracket from a near point (x) to infinity, is given by:

Where C is the overlap blur criterion that you wish to use and pragmatically x is measured from the entrance pupil, ie the non parallax point.

An alternative way of looking at the above is to note that the first term is simply H/x, ie the hyperfocal distance divided by the near point of focus distance. Thus the number of brackets you need can be estimated from (H/x + 3)/2 or rounding up as H/(2x) + 2. Putting x = H/k, ie a fraction of the hyperfocal, we get the linear relationship (k + 3)/2, ie the number of lens rotations you need to make between the nearest point of focus and infinity.

Using the above equation, let's look at a 150mm focal length lens (in fact my EFM 18-150mm) at an aperture of f/8 and a CoC of 19 microns, the maximum, ie worst, CoC one should consider for a Canon APS-C sensor.

In the above we see the number of brackets to be captured as we vary the near point of focus between a near focus distance of 0.45m and 5m. Clearly, once the near point of focus becomes much less than, say, 4m, the number of brackets increases rather sharply. In this case, at a near point of focus of 0.45m, the number of required brackets is over 160.

Of course, one could close down the aperture to, say, f/16, but many would not find that an acceptable thing to do because of diffraction, especially on a crop sensor.

The alternative would be to reduce the overlap blur criterion, but as it is already at 19 microns, this, once again, would not likely be an option that many would take, ie introducing 'focus gaps’.

The following graphically shows the impact of going much beyond, say, 50mm and taking a deep focus bracket set. The chart shows two focal lengths: 50mm, the lower, curve, and 150mm, the upper curve. As before we are plotting the number of brackets against the near point of focus, from 0.45m to 5m. Remember, the top curve is just over 160 images at 0.45m:

And the same curves as a log plot:

Plus a linear plot where I’ve extended the near point of focus out to 50m, to further illustrate the sharp increase in the number of focus brackets as you approach the minimum focus distance:

Finally, putting the near point of focus in terms of a fraction of the hyperfocal distance, from 2 to 100 or 20, the number of brackets, ie lens rotations, looks like this:



Thus, we arrive at the following general conclusions:

  • In-camera deep focus bracketing is ideally suited for wide angle lenses. In real world space, the focus position move varies at each focus step, but the lens rotation remains the same for each focus position;
  • Although macro in-camera bracketing is obviously achievable, you will need to take a large number of brackets if you wish to capture a quality stack, eg low diffraction impact, no focus gaps and over a reasonable total depth of field, ie x to y. Macro focus bracketing is different to deep focus bracketing, as the near and far depth of fields are essentially equal each focus step;
  • Deep focus bracketing telephoto lenses beyond, say, a full frame 50mm focal length, will potentially result in large bracket sets, according to the aperture, the overlap blur selected and the position of the near point of focus: so think about settings carefully. As a rule of thumb, if you wish to keep the size of the bracket set low, keep the near point of focus longer than, say, a tenth of the hyperfocal, which will result in no more than, say, seven brackets. Remembering you can calculate the hyperfocal in your head using the Rule of Ten, see the featured post link on the right. 

Finally, this link will allow you to explore your own non-macro lenses. The link will open the equation in Wolfram Alpha, where you can change the equations, ie it is set up to compare two use cases, and set the input variables, as you wish.

As usual I welcome any comments on this post or any of my posts.

­­