To take good photos of model railways it's really important to control the depth of field or focal depth of the image. This is best demonstrated by @KNP's wonderful photographs of his masterpiece, Little Muddle.
This blog entry describes my first experiments in improving depth of field in my photos.
Why Depth of Field matters
Definition: The Depth of field is the distance between the nearest and furthest objects that are acceptably in focus.
I'm not a photography expert and I don't claim to understand all the technicalities of depth of field but in a nutshell, the closer the camera is to the subject, the smaller the depth of field. Or to put it another way, when the camera is close to the scene only details at a very specific distance from the camera will be in focus and the rest of the image will be blurry. (This is to do with the angles of light rays entering the camera.)
Real world photos have a much deeper range of good focus because of the greater distance between the camera and the subject. (Technically, because of the smaller angles at which the light rays enter the camera.)
So small depth of field is a problem when photographing models for two reasons:
- When you focus on a particular item of interest it means that many other details are out of focus. E.g. you focus on the smokebox of a loco and then the cab, which is only a few centimetres further back, is blurred.
- The lack of focus is not just annoying in it's own right but it's a dead give-away that you photographed a model, no matter how realistic your detailing was!
So we want a way to increase the depth of field when photographing our models and this is where technology comes to the rescue in the form of "Focus stacking" or "Focus merging".
A focus stacking algorithm analyses several photos taken at different focal lengths and mixes the best focused parts, the sharpest parts, to create one good image.
How to do focus stacking
To apply focus stacking you need to:
- Capture your images digitally. Many compact digital cameras and Smartphones have very good lenses and high resolution sensors and are perfect for this task.
- Capture a number of images without the camera moving. To ensure that the camera doesn't move while capturing the images you need you ideally need some sort of tripod. A mini tripod with a swivel mount and flexible legs is ideal.
- Capture images at a range of focal distances. You could attempt to refocus manually between each shot but it's much easier and more reliable to let the software on the camera do this for you. Some cameras have that feature built-in and there are apps for Smartphones to do it.
- Collect the images together and process them in a suitable software package. Many high-end photo processing software packages have the ability to perform focus stacking and there are some free apps and utilities.
My first experiment
I used my Android SmartPhone, a OnePlus 3, mounted in a swivel head on a small tripod.
To capture the images automatically I installed a free app called, OpenCamera, which gives much more control than the standard Android Camera app. Here it is in operation:
The two large sliders on screen set the front and back focus points for the stack. The smaller third slider is the zoom factor. The software is set to take 16 images in this example but it can take up to 200!
[Edit: OpenCamera requires a phone and a version of Android that allows apps to control the camera focus.]
To process the images I first tried an open source desktop application called CombineZP but I found it to be difficult to use and not very reliable. In the end I settled on Affinity Photo, a highly accomplished and very affordable desktop photo editing package which has a good focus stacking feature. (This was a hard thing for me to do because the Affinity software is "the competition" in my professional life!)
Here are two of the raw images, numbers 2 and 12 from the stack of 16:
You can see that image number 2 is focused near the smokebox door of the loco but the background is out of focus. And image number 12 shows the background train in focus but the loco is blurred.
Then the full stack of 16 photos was given to Affinity Photo and it produced this result (after cropping):
You can see that the process works and it was quite easy once I had gathered together all the necessary tools. I will do some more experiments and try some creative ideas.