Tuesday, November 12, 2019

More on tilted focus stacking with Tilter

In the previous post I mentioned tilted focus stacking, and I hear some may say, but why? 

Afterall, is not one of the advantages of a TS-E lens that you achieve an ‘optimum’ focus state/plane that you can’t achieve in a single non-tilted image?

Whilst this is may be true sometimes, especially if you are seeking out a single zone/wedge of focus within an image that will be ‘out of focus’ elsewhere, it is not generally true. For example, say you are in a Cathedral and you are shooting close to the ground and you wish to have the beautiful flagstones on the floor captured, from near to far.

With a TS-E lens you might seek to position your hinge point on or very near the ground plane and focus towards/at infinity. Doing this will achieve a focus wedge, with the blur at the edges of the wedge equal to the, so-called, circle of (least) confusion, setting: typically anything from 10-30 microns on a full frame, eg anything less than two sensor pixel widths being ‘pointless’. This scenario looks like this:




Here we see the (yellow) field of view of the TS-E lens, positioned at the appropriate J height, and the tilted depth of field of the TS-E, both relative to the cathedral floor.

But what if there was a upright tombstone that we also wished to get into focus and was within the FoV of the lens, for instance, but positioned at, say, H/3, as in this scenario:


Here we see a focus failure. An alternative approach could be to focus normally, ie non-tilted, on the tombstone, but, of course, the far depth of field would drop off too much (assuming we don’t wish to push the aperture down too much because of diffraction; as the tombstone is positioned in front of the hyperfocal/2. This would lead us to consider (planar) focus stacking, which, of course with Magic Lantern and my in-camera focus stacking script(s) is easy to achieve :-)

But if we reverted to a focus-stacked, non-tilted approach, the artistic dimension will be changed, eg no differentiation in focus, as focus stacking with a non-tilted lens will ensure everything from the near focus to, say, infinity, will be ‘acceptably’ sharp.

This is where tilted focus stacking could be a useful (artistic) tool, ie allowing you to keep a lowish (HQ) aperture setting, eg two stops down from the maximum aperture. Illustratively things look like this:


Here we see a second tilted image (red), relative to the first one, shown in blue. We have now achieved our goal: the cathedral floor is tack sharp, the near tombstone is in perfect (acceptable) focus and the rest of the image, above the second image’s top/near depth for field boundary is ‘out of focus’.

Before progressing, let’s remind ourselves of the (general) hinge model we are using, thanks to the work of others such as
Emmanuel Bigler and Harold Merklinger:

Here we see an important feature of the model, namely, at the hyperfocal (H), the depth of field parallel to the sensor is simply J, ie the hinge height, which sits vertically under the front principal plane of the lens. Also, if we are focused at x (x is also projected on the ground plane above for clarity, as it is in Tilter) in front of H, as above, we will be tilting away from the ground plane, and if we are focused beyond H, we will be tilting towards the ground plane.

All this tells us that the angle of plane of maximum sharpness, relative to the ground plane, may be simply estimated (ie we should not use the above for doing macro work) as simply atan(J/x). Thus at x = H, the far/lower, tilted DoF just touches the ground plane, with the plane of sharp focus at an angle of atan(J/H); and focused at infinity, atan(J/infinity) = zero, so the plane of sharp focus is along the ground plane, with the near/higher or far/lower DoFs equally positioned either side of it.

From the above, it is also relatively simple to estimate the number of brackets from the current focused position, ie upwards to cover the top FoV, behind H, and downwards to cover to the ground plane.

I hope in a later version to account for camera tilt, but, for now, Tilter assumes a zero camera tilt. However, the Tilter screen does now shows the estimated number of brackets to cover from the current position to the ground plane. For example, in the screen image below we see that the plane of sharp focus is positioned at an angle of 52 degrees and the lower DoF is at 27 degrees. We thus need to bracket down from here, if we wish to also have the plane of sharp focus along the ground. Tilter tells us that we need one more image, ie a total of two tilted focus brackets.

In this example, Tilter also tells us that the (U = Upper) half FoV is 26 degrees. This FoV feedback provides FoV estimates for landscape, portrait, fully shifted landscape and fully shifted portrait.


As usual I welcome feedback, including corrections [:-)], and any ideas to make Tilter ‘better’.

Saturday, November 9, 2019

Using Tilter


In the last post I introduced my latest ML Lua Script: Tilter. Which I created to support Tilt-Shift lens use, eg a 24mm TS-E L2 in my case. Note the script will need (minor) tweaking for a non 24mm TS-E L2.
 
As a minimum the script is useful as an, in-camera, education tool, which you can use without a TS-E lens, as long as the lens reports focus, ie dynamically showing how tilt and focus can change a camera’s depth of field.

However, the real power of the script is in how it supports/informs your TSE-E use, mainly in two ways:

  • As an aid to getting the best focus engagement, which with a TS-E lens is slightly more complex than with a non-TS-E lens;
  • As a tilted focus-stacking aid, ie to optimally extend focus beyond that achievable in a single frame.

It is important to understand that the Tilter is based on the hyperfocal distance (H), and that Tilter shows the side on camera view from the near field, that is from the lens’s (estimated) front principal (ie assuming a split thin lens model), out to 3*H. 

Thus, as you change the aperture, Tilter will always show the tilted focus wedge relative to the current hyperfocal. It may look that the tilt angle is changing as you adjust aperture, but, of course, it is not. Only the hyperfocal is changing. The tilt can only be changed by adjusting the lens or refocusing.

Since the first post I’ve added a couple of features, that I find useful.

First, Tilter can now show an estimation of the vertical Field of view of the camera – once again based on assuming a thin lens model. This can be switched off in the script’s menu and, because we are dealing with a lens that can be shifted, the FoV can be based on four sensor ‘sizes’ – in the case of my TS-E 5DIII, two real and two virtual:

  • Normal Landscape = 36x24mm (wxh)
  • Normal Portrait = 24x36mm
  • Vertically Shifted Landscape = 36x48mm
  • Vertically Shifted Portrait = 24x60mm

You need to explicitly set the sensor configuration in the Tilter’s menu. Note that the FoV shows the full +/- shift cover, which of course requires post processing, pano-stitching to achieve: which, by the way, is easy to achieve in LR.

Also note the this version of Tilter assumes the lens non-tilted axis is parallel to the ground plane. You can still use Tilter with a camera that is rotated relative to the ground plane, and I'll discuss this in a future post.

Second, Tilter now shows an estimate of whether the focus on the ground plane is within the FoV of the above set sensor configuration. This is shown by four dots, whose display, once again, can be switched off. If the dot is red then the focus is behind that particular FoV marker, if green it is in front of that FoV. The left-hand dot represents the widest TS-E setting, ie the 24x60 configuration above, and the right-hand dot is the narrowest (36x24mm) configuration. Once again this can be switched on and off: note is off in this post.

Note that you may be disappointed with this feature as the number of differentiating focus steps that Canon reports in the ‘far field’ is not large. That is, you may see all red or all green dots. 

With the FoV switched on, the screen now looks like this:


Note that the centre dot, used for focus stacking, is red; as, in this case, no image has yet been taken. Plus we see that all the dots are green in this case, ie focus is set in front of the narrowest FoV. We also see the tilted DoF relative to the FoV.


There are two main use cases for the Tilter, ie beyond the educational one. In this post I’ll cover the non-shifted use case where you wish to ensure the ground plane (near to far) is in focus, but that the vertical field of view, in the near or far field, may not be enough, ie you need to do tilted focus stacking.

Of course, with a tilting lens we have two definitions of ‘the ground plane is in focus’. First we can elect that the lower/far DoF (just) touches the ground plane, as shown here:


Secondly, we could elect that the plane of maximum sharpness (‘zero’ optical blur) aligns with the ground plane, as shown here:
 

One use case is that I’m seeking to ensure the ground plane is tack sharp, ie the tilted plane of maximum sharpness is coincident with the ground plane. In addition, the lens is set up to be parallel to the ground plane, ie no additional angles to worry about.

Step 1: focus the TS-E lens using whatever method you like, eg some like setting a closed down aperture, ie F/3.5, and iteratively bending for the background and focusing for the foreground – followed by opening the aperture to the required shooting configuration and setting the exposure. With Tilter you can also estimate the height that the centre of the lens is away from the ground plane and use the Tilter menu to help you approximate the initial tilt angle. In this case, my 5DIII was about x mm above the table top, so Tilter helped me estimate that the initially set tilt should be y degrees. I then used the iteration method to arrive at the final tilt-focus settings and this first image, which could have been an exposure bracket set:

Step 2: using the on-screen Tilter image, assess if the DoF is enough for your needs. That is all the things you want to be ‘in focus’, ie not outside of you defined CoC focus criteria, are in focus. If they are, you’re done! Also, note that the centre dot of the Tilter feedback is now green, indicating that the current focus is overlapping the last taken image: which of course it will, if you haven’t yet refocused.

Step 3: Assuming not everything is covered by your single image, you now need to use tilted focus stacking to achieve a greater DoF coverage. Without Tilter this would be difficult to impossible, as you would not know how much to refocus to achieve an image to image focus overlap. As we are focus stacking from the ground plane, all we need to do is to refocus towards the camera, ie away from infinity, and watch the focus stacking feedback in Tilter. That is refocus towards away from infinity until the centre dot turns red, then (nudge) refocus towards infinity until it just turns green again. On the RHS of the Tilter screen you also have some data to help you out, ie angles and the optical blur (set in the ML menu), as well as the diffraction blur and the convolved total blur, ie at the depth of field (angular) planes. Take your next image and re-evaluate the situation in Tilter, ie have you covered your needs yet? If not repeat Step 3.

To further help with tilted focus stacking, it is often useful to know the angle of the highest object you wish to see in focus. You could guess it, but a better approach is to use some technology. For instance, I use the Theodolite app from http://hrtapps.com/theodolite/


Once you have taken your image data, all you need to do is post process your images, eg:
  •  Ingest into LR and undertake any RAW-based, eg WB etc, processing, and sync across all your images 
  • Merge any exposure brackets you took
  • Focus stitch your (merged) images in the application of your choice, eg Helicon Focus
  • Return to LR
  • Make your art by further post processing

In future posts I will look at other use cases and, hopefully, provide some real world examples.

As usual I welcome feedback, advice and, in this case, any Tilter development suggestions.

Monday, November 4, 2019

In-camera TS-E Lens Simulation

Anyone with a tilt shift lens knows that they take a bit of effort to use. Shifting is relatively easy and a great way to achieve panoramas, for example, this pano, of the Fairy Pools in Skye, was taken with my 24mm TS-E, using positive and negative vertical shifting.

  

When it comes to tilting, things get a little bit more complicated, especially if you go back to basics and try and understand the Scheimpflug principle. 

Lucky others, such as Emmanuel Bigler and Harold Merklinger, have created an accessible way of modelling a tilted lens:


Where the J height is simply the focal length divided by the sine of the tilt angle.

To complete the model, as the hyperfocal distance is measured from the front principal plane, but Canon/ML gives us the focus distance from the sensor plane, a split thin lens model is used to calculate the TS-E 'thickness'. See http://photography.grayheron.net/2019/05/splitting-things-apart.html

As can be seen, a tilted lens has a very simple geometry that results in the angular depth of field being the J height, at the hyperfocal, ie parallel to the sensor plane.

Using the above model, it is a simple process to write a Magic Lantern Lua script to provide in-camera feedback and functionality.

The script is called Tilter and, as usual, can be downloaded from the right.

The script is positioned in the ML Focus menu and has two menu items. The first one simply switches the script on and off. The second allows the user to enter the estimated hinge angle. The menu offers 1/10 degree increments, but setting a TS-E lens to better than half to a third of a degree is about the best you will achieve.

The menu looks like this:


The Hinge or Tilt Angle, which is adjusted in 1/10 degree increments, dynamically shows the J height in cm. That is the position of the 'ground' plane, vertically below the (down tilted) lens and parallel to the non-tilted lens axis. In the above screen shot, the Hinge Angle has been entered as 7, ie 7/10 of a degree, and at a focal length of 24mm this equates to a J height of 196cm.

The script, obviously, runs in LV, and if turned on the user interface looks like this (note the camera settings are purely illustrative and note I'm handholding):


On the left we see a representation of : 
  • the ground plane (white horizontal line) that contains the hinge point;
  • the point of focus, as projected on to the ground plane;
  • the lens axis (orange) that is parallel to the ground plane;
  • the depth of field wedges (upper and lower) and the plane of sharp focus, all pivot around the hinge. The plane of sharpest focus passes through the point of focus of the lens, on the (non tilted) lens axis;
  • the hyperfocal distance, ie the white vertical line;
  • the ground plane is projected out to three hyperfocal distances, with 2H also shown as a tick mark;
  • the red dot at the (far left) centre of the display is used to provide focus stacking feedback; turning green if the current focus overlaps the last image;
  • finally, 15 degree tick marks are shown for convenience.

On the right hand side of the screen, various numerical data are shown:

  • The upper depth of field (U);
  • The plane of maximum sharpness (F);
  • The lower depth of field (L);
  • The J height in cm;
  • The optical, diffraction and RMS total blurs, in microns. Note the optical blur is that set on the ML DoF menu for the 'circle of confusion'.
The script uses a 'corrected' ML calculated hyperfocal, and ML should be set to simple mode, ie not diffraction aware. The correction being a single focal length, as the ML hyperfocal distance assumes a thin lens at infinity. 

In the above example the focus is set less than the hyperfocal and thus shows as a yellow dot, through which the plane of sharpest focus passes, ie if the dot was positioned on the lens axis. In this case the angle is estimated as 48 degrees. 

In this case the upper depth of field, ie where the optical blur equals that ML set CoC, ie at an angle of 57 degrees, and the lower is at 34 degrees. The J height being 1.96m, eg the camera is on a tripod at 1.98m above the ground.

The blurs show that the ML CoC was set to 20 microns and the diffraction blur is estimated at 8 microns, giving an RMS total blur of around 21 microns.

To consolidate what is happening, let's look at another screen shot:


In this example I'm using a very high aperture (f/18, giving a diffraction blur of 24 microns). We now see that the focus point has turned green, meaning that I'm focusing between H and 3H. Beyond 3H, the focus point turns red. Focusing beyond 3H will be difficult with a 24mm TS-E, as Canon focus feedback collapses in the far field, ie relative to the near field.

The above shows the optimum configuration for tilting, where the lower depth of field covers the ground.

An additional feature of the script is that it supports tilted focus stacking. To use this, simply take an image. The next image will now be referenced to the previous and if the (slanted) depths of field positively overlap, the red dot at the centre of the circle will turn green.

In subsequent posts I'll talk about work flow and how to achieve tilted focus stacking.

As usual I welcome feedback on this post and the script.

Sunday, October 6, 2019

Hand Held Bracketing Script - Update

I've slowly been refining my latest, relatively, simple Hand Held Bracketing Script (down load from the right).

This script was developed to allow quick access to the ML Advanced Bracketing (AB) for one specific use case, namely hand holding a wide angle lens in a high dynamic range environment, for example if in a church or cathedral, or if you wish to take some indoor shots.

The latest version respects the AB settings, that is the script will run and reset the AB settings after running. The script will run in LV or non-LV mode, and is agnostic to the AB being on or off. However, the script does switch off the AB after running each bracket sequence.

As I'm not out 'doing photography' at the moment, here is a test bracket sequence I just took with my 5D3 and Rokinon 12mm Fisheye, at F/8: BTW a lens that I find pretty impressive, especially for inside work.

The focus was set at 2*H, for infinity sharpness, ie an infinity blur around 15 microns.

I used ML's ETTR to set the base exposure (but you don't need to use ETTR to set the base exposure), which in this case was 1/100s at ISO 100. I then held the half shutter for just over 3 secs (this is adjustable in the script) and gently released to start the bracket capture, which resulted in a three image bracket set: 1/100s @ ISO 100 + 1/30s @ ISO 100 + 1/30s @ ISO 1600.

The 1/30s was set by the script from the min shutter value I had set in ML's ETTR. The ISO 1600 was my explicit ISO setting in the script, ie I could have set 800 or 3200. The ISO 1600 is, of course, my ISO invariant capture, which guarantees the highest DR capture, ie at the slowest shutter I can tolerate hand holding, ie 1/30s,

The three captures look like this:



 

These were ingested into Lightroom, and, as I captured an ISO invariant image at 1/30s and ISO 1600, I created an additional virtual copy of this image and increased the exposure in LR by 1 stop.

These four images were then processed in LR's HDR Photo Merge, giving me the following base-processed image, after a little LR tweaking in the develop module.


I then did a round trip to Photoshop and processed the above with FisheyeHemi 2, giving me the following final image in LR, after a little bit more tweaking and transformation.


Bottom line: If you ever need quick access to a handheld bracketing, then this script may be of value. As usual I welcome feedback.

Wednesday, October 2, 2019

Hand Held Bracketing Script - Version 2

A short post to introduce my Magic Lantern latest script: an updated Hand Held Bracketing Script.

The script has been written for a specific use case: namely when you can't use a tripod and you are in a high dynamic range environment, eg like a cathedral, and a single image, dual-ISO or not, isn't sufficient.

In addition, the use case is best exploited with a wide angle lens, ie focal length less than, say, 30mm.

The script is based on your base exposure being set for the highlights, eg following an ETTR. But you can set the base exposure anyway you wish. In addition the script makes use of the minimum shutter setting in the ML ETTR menu: so this must be set, eg at 1/30s, say.

The script 'exploits' the fact that Canon cameras exhibit ISO in-variance above a certain ISO, usually around 1600. Setting the ISO above this in the camera is usually pointless, ie all you are doing is reducing photon capture. Of course, your shooting needs may dictate higher ISOs, eg shutter speed: but that is your choice.

The script's menu allows you to control the script's functionality:


On or Off simply does what it says.

Delay allows you to add an additional delay before the script functions.

ISO logic allows you to select the bracketing ISO, eg "Float", "800", "1600" or "3200". If float is selected the ISO bracket will be taken at the ISO Ev lift, as set in the next menu item. Thus, if the base ISO is 100 and the Ev lift is set to 3, the ISO bracket will be taken at ISO 800.

If the ISO logic is set to an explicit value, eg 3200, the maximum ISO bracket will be taken at that value, irrespective of the base ISO value.

The script is triggered by doing a long half-shutter press of more than 3 seconds.

The script will take either two or three brackets. 

If the base shutter is equal to or slower than the ETTR min shutter setting, then the script will take two brackets:
  • Min Shutter at base ISO
  • Min Shutter at the higher ISO
If the base shutter is faster than the ETTR min shutter setting, the script will take three brackets:
  • Base Shutter at base ISO
  • Min Shutter at the base ISO
  • Min Shutter at the higher ISO
The script sets up ML's advanced bracketing, so you don't need to worry about any starting values. However, at the moment, the script doesn't reset the advanced bracketing back to the start condition. In fact the advanced bracketing is left on.

To illustrate the output from the script, I used my 5D3 with an IRIX 11mm at F/4. The test subject was inside my house, looking up at the ceiling lights. I ETTRed, with a min shutter of 1/30s, to generate a base shutter of 1/125s at an ISO 100. I set the explicit ISO to 3200.

The script took the following three exposures:


 

I ingested these into Lightroom and used LR's HDR Photo Merge to generate the following image:

As usual I welcome any feedback on the script, ie its usability or ideas to make it better.

Sunday, September 1, 2019

Further thoughts on 'virtual' 645 Photography



Previously I have written about the Vizelex RhinoCam, that allows me to use Mamiya 645 lenses with my crop sensor EOSM.


With the recent update to Lightroom, I thought I would see if this version coped better than the previous version, when stitching the 645 panos.

I used my 35mm Mamiya lens and focused at just beyond the hyperfocal, noting that at this format the 'just acceptable', circle of confusion is some 48 microns, compared to about 30 microns on my full frame 5D3.

I framed the image using the viewing screen (which is upside down of course) and, using Magic Lantern, set Dual-ISO and then ETTRed for the highlights. I switched between the various ML states using my Cycler script.

The eight base images looked like this, after ingesting into Lightroom and Dual-ISO processing:









I next selected the eight images for stitching and used the LR pano merge feature, which after a bit of LR tweaking resulted in this 645 image, ie taken through a 645 lens at full field of view coverage, resulting in a 12300x9670 image (scaled to 6000x4714 here).


Bottom line:just because you have a cropped sensor camera, ie an EOSM, it doesn't restrict you to exploring other camera formats, all the way up to 645 :-)

Friday, August 16, 2019

Thank You Adobe

For anyone processing brackets, you will know about 'the trick' of going into the Library module, repeatedly selecting your bracket sets and using (PC) Alt-G to place them in a stack. Once in a stack you could then run LR/EnFuse in batch mode: but Lightroom's HDR merge did not recognise the stacks!

Thus you had to individually send each stack to LR's HDR Merge...until now.

Lightroom's latest release now includes a batch mode functionality for its merge tool, so you can batch process exposure brackets.

As a simple test, I took an exposure and focus stack with my EOSM3, using my CHDK M3 script.

I set the camera to F/8 at 11mm and (inadvertently) left the camera on ISO1000. Using the CHDK histogram I set an ETTR base exposure, set up the script to focus stack from the lens minimum focus and to take an additional (Zero Noise) exposure, at each focus, at +4Ev. Finally I set the overlap to 20 microns (which established the hyperfocal in the script, H) and the infinity shot to 3 x H, ie an infinity shot at about 7 microns.

This resulted in 6 focus brackets, four from the lens focus minimum to about H/3, one at H and one at 3H.

After ingesting into LR I first put each of the 6 focus bracketed exposure sets into a stack. Then I selected the 6 stacks and selected the LR HDR merge, which, with its new functionality, created 6 HDR images, that is one for each focus point.

This was followed by a round trip to Helicon Focus and voila I ended up with the, non ISO100, test shot.



As I say, thank you Adobe.

Postscript: here is another test image, this time at ISO100 ;-). Only needed 8 images, ie 4 focus brackets, each with 2 exposures.


Postscript-Postscript: and what the 12mm Rokinon Fisheye sees from the same position, defished with FishEye-Hemi.