CHDK Wiki
Advertisement

"DoF Stacking" using CHDK DoF Bracketing & CombineZM

"Bracketing" is the taking of a series of shots with an incremental, usually subtle change in a variable between each one. Bracketing can be done with changes in shutter speed, ISO, aperture value, focus, etc, and though a bit challenging, several variables can be bracketed in combination, as well. Usually bracketing is done in order to cover a range of the variable values in an effort to capture the best of several shots. In such cases, bracketing can be done hand held, "on the fly" so to speak, and is most likely done in "continuous shooting" mode. More probably, the photos are viewed after download side by side as thumbnails (or further scrutinized in a browser), the "pick(s) of the litter" is kept, and the rest are discarded.
Focus Bracketing is the taking of a series of photographs where the point of focus is moved incrementally between each shot. This is usually applied to macro applications where depth of field is notoriously shallow. But there's something much more fun we can do with a handful of focus bracketed shots!
"DoF Stacking" is where we combine, or "stack" a selection of focus bracketed photos in a similar manner to the way that three or more images are combined to make single HDR photos. The resulting image from DoF stacking can have usually paradoxic qualities; the grand detail of a superb macro shot with the depth of field of a landscape shot. And CHDK makes it incredibly easy!

To appreciate what a DoF stacked image is, compare a photo you have taken at infinity with your favorite macro shot. Notice the tremendous range of distance of objects that are in focus in the photo taken at distance as compared to the extremely short focus range in the macro shot. We will create a macro shot where everything is in focus.

We need:
A camera running CHDK
A tripod
A computer with CombineZM installed on it
First download CombineZM. CombineZM will take our photos of differing focus points and merge them all into one single digital image that illustrates a depth of field far beyond the capability of most P&S (point and shoot digital) cameras, and in some cases, beyond the capabilities of any known lens configuration. It is free and easy to use, and although it offers great customization, it will produce a stunning result straight from it's initial download. (It's also great for superimposing two or more completely different images for some very interesting results.)

There are a few other freebies out there, but CombineZM is referred to quite a bit throughout the CHDK wiki and forum, so you're more likely to get help with this program than the others out there. It's also still constantly being upgraded by it's author(s), which is always a good thing. Download it from: http://hadleyweb.pwp.blueyonder.co.uk/CZM/News.htm

Next thing we need to do is pick out a subject and set up a tripod. Choose something stagnant for now. Let's take as close-up of a macro as we can get and we'll take about a dozen shots the first time to get a feel for how the camera behaves. With very little experience you'll quickly find that you can get a wonderful result with only a few shots. Ready the camera, and load up CHDK. Turn off all other priorities you may have enabled in CHDK so that we are only utilizing the DOF bracketing.
In the CHDK ALT menu, go in to
  • Extra Photo Operations, scroll down to
  • Bracketing in continuous mode, making certain all other functions are set to "off" along the way. In that menu, navigate down to
  • Subj. Dist. Bracket Val.

Next to this you'll see this:

  • [ 0].

This is your "distance", and it can be changed by increments of "1". The next menu item below that is the "multiplier", ant that can be changed by exponential factors of "ten". In this manner, very long distances of many meters can be set. It says:

  • Value factor (mm)[ Off]. Assuming you are photographing something very close, a good bet for now would be to set the focus change to move 3 millimeters in between shots. To do this, we will set the
  • Subj. Dist. Bracket Val. to 3, and the
  • Value factor (mm) to 1. This will make the focus increment 3mm. Navigate down to
  • Bracketing type, and set that to [ + ]. This will ensure that the focus gets moved outward 3mm for each shot. Navigate down to
  • Back, and then up to the top of the previous menu,
  • Extra Photo Operations. Be certain that the option
  • Disable Overrides is CHECKED.
Exit the CHDK ALT menu, and set your camera to Macro Manual Mode. Set it to shoot continuously. Set your ISO and shutter speed preferences.
Now with your tripod/subject in place, focus (usually half shoot) in on the subject at the clsest point, or even on something just in front of it, and lock your focus. (remember, each shot will focus 3mm farther away from the last, so we want to ensure we don't miss the closer focus.) Set or lock your EV (light metering) to ensure as much continuity as possible.
Now reenter the CHDK ALT mode and enter the menu. In
  • Extra photo operations, be sure that
  • Disable Overrides is UNchecked.
Exit the CHDK ALT mode, and you should be all set to shoot.
The reason we had to disable the CHDK overrides before setting the focus lock is because in some instances (at least with my TX-1) I have had the camera shut down while trying to set focus lock. I suspect it's receiving two commands to the same bit of hardware and doesn't like it. So the overrides need to be disabled first, at least for me.

Please keep in mind that these are generic instructions. Most Canon P&S cameras have the same focus and Ev locking methods, as far as I know, but if you are having difficulty with that part, please consult your owner's manual before asking on the forum. Please find the DOF Stacking thread, located here, and post any questions you have to that thread to make searching easier for everyone.

Fire away!
Depending on your subject size, you should take between 1 and 2 dozen shots. Better more than less, and the reason is that I can't definitively say that when CHDK tells my TX-1 to focus 3mm out before the next shot, it really actually is 3mm, nor can I guarantee that the fifth shot it takes has focused out the same distance as the second. Even if I could, who is to say that there are not disparities from one Canon model to the next with this regard, or even from one camera to the next of the same model?
So snap away, and get a feel for how your own camera reacts to CHDK's focus commands by comparing thumbnails. My personal approach to these is to snap a few dozen and eliminate what I won't use. For example, I once shot over 50 shots of a subject. I didn't know at the time that it wasn't necessary, as I was still unfamiliar with my own camera's reaction to CHDK's focus commands. After downloading the images, I discarded everything before and beyond the focus range of the subject. I was left with about 36 images, still too many to use. (I found out the hard way that stuffing 3 dozen images into CombineZM takes a LONG time for it to compile!) So I simply kept every third image, starting with the first one, and discarded the rest. I ended up with a dozen equally spaced images that yielded a great result.
After downloading your images, open CombineZM. In the toolbar at the top click "File", and then click "New". A small window will open that says, Combine ZM Progress..." on the top. In XP, it will also prompt the automated "File Open" Microsoft window. (If not, then open the computer operating system file which contains your image collection (A Windows file instead of a Zoom Browser file, for example) and highlight the list of images or the thumbnails. Simply "drag 'n drop" them right into the small CombineZM window.) If the automated window has opened, simply select all images and hit "open".
CombineZM does the rest!
Here are my first and second DoF Stacking images:


File:Fingermacro.jpg

Advertisement