Posted: Tue May 04, 2010 7:02 pm Post subject: What is "stack-and-stitch", and how can I do it?

"Stack-and-stitch" refers to shooting multiple focus stacks of the same subject and stitching them together side by side to cover a larger area.

This technique is most commonly used to create images that have very high resolution, far beyond what can be captured by the camera and lens from a single position. It can also be used to capture an especially wide angle of view, up to 360 degrees in the extreme case.

The primary challenge is to avoid "parallax errors". These occur when different stacks have different perspective, due to movement of the lens's entrance pupil. When this occurs, features of the subject that are at different depths will line up differently in different stacks, making it impossible to get a perfectly clean seam.

There are several distinctly different methods to overcome this challenge. They include:

1. Use a lens that focuses by internally moving elements that are behind the entrance pupil. These lenses are commonly found on compact cameras. See HERE for discussion. In this scheme, you shoot different stacks by rotating the camera around the lens's entrance pupil.

2. Hold the lens in a fixed position and focus by changing the lens-to-camera distance. This is typically done with a bellows rig, such as HERE or HERE. Again, rotate around the lens's entrance pupil.

3. Use "telecentric" optics. More precisely, use optics that are telecentric on the object side. These are unusual lens systems whose entrance pupils are effectively located at infinity. They stare straight forward, having zero angle of view and no change in magnification with distance. Stacks shot with telecentric optics naturally give orthographic (parallel) projection, so stacks for stitching can be shot just by shifting the camera and lens sideways, no rotation. (Rotating around the entrance pupil at infinity is equivalent to this shift.) This approach is convenient for scanning small specimens. Telecentric lenses designed for machine vision can be purchased for small cameras. For DSLRs, telecentric optics can be constructed by adding a carefully chosen auxiliary lens to an ordinary macro lens (see HERE). At higher magnifications, with some lenses, you can get the same effect by adding an aperture at a carefully chosen position (see HERE). Some microscope objectives are naturally telecentric, such as the Mitutoyo M Plan Apo 5X and all of the Nikon "toolmaker" objectives (TM series).

4. At sufficiently high magnification, you can just pretend that the optics are telecentric, by turning off the usual scale correction when stacking. This approach depends on shallow DOF to prevent radial streaking. It becomes viable when field size drops below 5 mm or so, depending on lens design and aperture. See HERE for an example. This approach is especially good when shooting through a microscope objective, where none of the other approaches are really viable.

5. If you're willing to either tolerate some stitching errors or to fix them up by retouching, then you can also use approximate solutions like focusing by moving the lens, and rotating around some average position of the entrance pupil.

Pretty much any stacking software and any panorama-stitching software can be used for these jobs. Stacking software includes Zerene Stacker, Helicon Focus, and CombineZP; stitching software includes Photoshop, PTgui, Microsoft ICE, hugin, and PTassembler.

Questions? What more needs to be said or linked?

--Rik
Edit: added Photoshop to the list of stitching software. I've left Photoshop off the list for stacking only because of its recognized limitations in that area.
Edit: added mention of some microscope objectives that are naturally telecentric.

Last edited by rjlittlefield on Tue Mar 14, 2017 11:37 am; edited 3 times in total

I dont know whether this would work or even contribute to the discussion here but could a (well set-up) panoramic head be used to rotate around the entrance pupil (front element of the objective) to reduce later work required to clean-up?

could a (well set-up) panoramic head be used to rotate around the entrance pupil (front element of the objective)

In theory yes. In practice it would depend on how tradeoffs work out for the whole system. I think the best chance with this approach would be to use an infinity objective in front of an internal focusing tube lens so that nothing outside the lens would have to move.

By the way, the entrance pupil of an objective is often not its front element. As always, the entrance pupil is the apparent position of the limiting aperture. In many objectives that position is outside the lens, either in front or in back, courtesy the effect of refracting elements in front of the physical aperture. Often the entrance pupil is much farther away from the subject than the front element is. I have a couple of 10X objectives that are almost telecentric by themselves.