Este artículo también está distponible en Español: Como aumentar la profundidad de campo en fotografía macro.
One of the most common problems in macro photography is the small depth of field: obtaining a photography where all our scene is focused is not an easy task; when closing the diaphragm is not enough (or convenient), we have to make use of other techniques.
The depth of field of a photography is the part of the scene which is on focus: everything behind or in front of that zone is out of focus. The size of this zone depends on three factors:
- The focal length of our lens: a longer focal length will produce a shallower depth of field.
- The diaphragm: an open-wide diaphragm will result in a shallow depth of field, too.
- The distance between the camera and the subject: again, a short distance means an small depth of field.
In macro photography, the distance between the camera and the subject is very small: frequently, between the front of our lens and the insect or the flower that we are trying to photograph there are hardly a few centimeters, sometimes even less. And the lenses used do not have specially short focal lengths, usually 60 or 100 millimeters.
Under these circumstances, the depth of field becomes as shallow as a few millimeters, clearly not enough for most scenes. Then, all we can do is close the diaphragm as much as possible, but sometimes even this is not enough. We also have to take into account the consequences of light diffraction: when the diaphragm is very small, there is a significant loss of image quality.
The technique that I will explain in this article is called "focus stacking". Basically, what we are going to do is take several photographs, changing the focusing point on each shot, and then merge them with our computer.
With this technique, we must always use a tripod, because the photographs must be perfectly aligned; I do not recommend this technique to shot insects and other moving subjects. Our camera must be placed in a position such that we can focus every part of our scene moving just the focusing ring, without displacing our camera; focusing rails are not recommended, too.
We will begin focusing on the far extreme of our scene and taking a picture; then we have to move the focusing ring very slowly, as we keep taking photos. Sometimes, two or tree photographs will do; but other scenes require ten, twenty, or even more photographs.
Even if we used a tripod, and we are completely sure that there was absolutely no movement between photographs, changing the focusing distance produces subtle differences between the images, big enough to ruin the final result. After we have downloaded the files to the computer, we must align the photographs. This step will be performed using align_image_stack, one of the tools included in Hugin. Assuming we have all our photographs in the same directory, all of them as TIFF files, we execute the command:
align_image_stack -m -a AIS_ IMG_????.tif
I suppose we could cut-and-copy the files, to select by hand the focused parts from each image, but that could be very time-consuming and boring. Fortunately, we can do this automatically using Enfuse (also included in Hugin):
enfuse -o result.tif --wExposure=0 --wSaturation=0 --wContrast=1 --HardMask AIS_????.tif
There is also a
--ContrastWindowSize parameter to control the quality of the final image: the default value is 5, but it can be increased to 7 or 9, to obtain a better result; however, the time required for the process will increase, too.
I wanted to take a detailed photography of this orchid we had at home:
The flower is about five centimeters wide, and there are almost two centimeters between the front and the back of that flower: far too depth for a conventional macro photography. What I did was take 20 different photographs, as described above; even though I stopped down the diaphragm to f/16, the depth of field was really narrow:
Using the focus-stacking technique, I obtained this final picture, perfectly focused from front to back:
Not the prettiest picture of an orchid, perhaps; but I think is serves the purpose of illustrating this technique quite well.