August 27, 2022

Focus stacking cheat sheet

This is intended to be my shortest and most succint set of instructions (for myself) about how to take focus stacking photos. I add things after I make stupid mistakes and forget things.

The first rule is Read this sheet -- every word. Because it is brief, everything is important. If you ignore this advice you will miss something important, be upset and angry and probably just be wasting time because you have to start all over.

A quick note up front about the BBB focus controller. Be sure to do a shutdown and don't just turn of the power when you are done. Use "putty focus", login and give the shutdown command.

Connect cables and turn everything on. This may be as easy as plugging in the power strip.

Set up specimen, diffusors, lighting, etc.

Start lightroom, start tethered shooting, (Use: File -- tethered capture -- start tethered capture). Click "live" button to get live view. (This works on my Canon 1D, even though it is not on the supported list). Be sure the session name is 2023_tether, the starting image number is 1, and the location to save is "lightroom/2023".

Do some test exposures (use the shutter button on camera) and get the exposure setting set up right. You have to shut down live view to do this. Also, as I currently have the camera set up you must press the shutter twice. The first time raises the mirror, the second trips the shutter. The handy button in the tethered capture window does not work, at least not with the camera set up to require two pushes, or maybe not at all. Aperture (only for the MPE-65) should be set wide open to minimize diffraction, at least for 4x and 5x magnification. Check white balance at this stage also.

Use lightroom to delete any test exposures (use Ctrl-A and then remove them all).

Launch Chrome. Start the focus GUI in a browser window on http://192.168.0.31:1776. (Or just use the following link).

The BBB now starts the required server on boot. You no longer need to login and start things up.

Set top and bottom for focus stack with the aid of live view.
The stage has positive numbers with the camera in higher positions.

Be sure that both top and bottom are set, just moving to the desired position and admiring it does not set either of these.

Set the step size by typing into the entry field next to the "Go" button and hitting return. Ensure that the step size gets copied and displayed to the left of the entry.

Turn off live view or the shutter cannot be controlled.

Click the "Go" button. The stage will move to the bottom position (the lowest) and start the stack. The shutter should begin clicking and images should pile up in the directory "lightroom/2022/2022_tether".

When it is done, use Ctrl-A to select them all and export them as TIFF with no resizing, no renaming, no sharpening.

The actual stacking

For this, I move to my Linux machine with a big monitor. Doing the stacking and editing on my Linux machine allows me (in theory) to be taking stacks with my Windows machine while processing the stack on Linux -- but I actually never do that.

Start Zerene. I do this on my linux machine and just type "zerene" at the command line.

You can drop all the images into it (if you are on Windows). Better yet, use File -- Add files. On my linux machine the files will be at:

/u1/Camera/lightroom/2023/2023_tether

Using "Add files", navigate to the above directory, use Ctrl-A to select them all, then click the "Open button". I have some old notes that say that Ctrl-A does not work, but as of 2023 it seems to work fine. Zerene may complain about files it cannot deal with, but it just ignores them.

Use Stack - align & stack all Pmax (until I learn better). This takes 2 minutes for about 100 images (10 mpx images) on my current computer. I hear my processor fan crank up. Zerene beeps when it is done.

When Zerene is done, use File -- Save output image. Do not use "save project". I save to "lightroom/2022/2022_minerals" directly from Zerene.

Now I have to tell lightroom to import that image. There may be a better way, but for now I use "import", navigate to "P:lightroom/2022/2022_minerals", do an "uncheck all", then check on the single new image, and then do the import.

Now I edit the image. Don't forget to sharpen it!

After this, I clean up -- I use lightroom to delete the DNG files from the tethered capture, and windows file explorer to get rid of the exported TIF images so I am ready for next time.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org