Docs · Stacking
Aligning the frames
Before stacking, Deptheos lines each frame up with the one before it, so the subject stays in place while the focus moves through it. There are two aligners, ECC (Enhanced Correlation Coefficient), the default, and the grid search, chosen for each stack under Alignment in the inspector.
Which one to use
Use ECC unless a frame moves further between shots than ECC allows: 5 % of the frame in shift, 5 % in size or 5° of rotation. A stack shot on a tripod or a focus rail moves far less than that from frame to frame, a fraction of a percent, and ECC finds that motion to a fraction of a pixel.
Switch to the grid search when:
- Frames jump between shots: a stack shot by hand, a rail that slipped, or large focus steps with a lens whose magnification changes a lot as it focuses. When ECC leaves frames out for moving too far, the notice after the stack says so. If the grid search still leaves frames out, raise its limits in Settings ▸ Alignment.
- The exposure changes through the stack. Turn on Exposure compensation in Settings ▸ Alignment as well, so each frame is brought to the first frame's brightness.
How the two compare
Both align each frame to the one before it and chain the steps together, so the last frame's position is the sum of every step before it. They differ in how they search for each step and how far they let a frame move.
| ECC | Grid search | |
|---|---|---|
| How it searches | Starts from no motion and improves its guess step by step, on small copies of the frames first, then larger ones | Scores a spread of guesses across its limits, then finer ones around the best |
| What it finds | Shift, rotation, size, stretch and slant (a full affine transform), to a fraction of a pixel | Shift, rotation and size only. Stretch and slant are small in a focus bracket, but grow toward the corners, where missing them can soften fine detail |
| How far a frame can move from the one before | 5 % of the frame's width or height in shift, 5 % in size, 5° of rotation. Fixed; a frame that moves more is left out | 5 % of the frame's longer side in shift, 3 % in size, 1° of rotation by default; Settings raise these up to 25 %, 15 % and 10°. It can also follow a match past the edge of its search |
| Brightness changing between frames | A change across the whole frame is ignored; uneven changes, such as light that moved, are not | Allowed for while it searches. Exposure compensation also applies it to the stack, for stacks shot at varying exposure |
| A frame it can't align | Left out when the frames correlate poorly (below 0.6, where 1 is a perfect match) or overlap on less than a quarter of the frame, or when the motion exceeds its limits | Left out when its best match is hardly better than two unrelated pictures would give. After a featureless frame it has nothing to judge by and keeps the frame, so check the result |
| What it needs | Detail in the frames; a plain, smooth subject gives it little to follow | The same |
| Settings | None | Its limits and Exposure compensation, in Settings ▸ Alignment |
| Time | 5.2 s for 200 JPEGs, aligned and stacked with the pyramid | 5.3 s for the same, at its default limits; wider limits take longer |
Frames left out, the stack's direction, and the crop
A frame that can't be aligned
A frame either aligner can't place is left out, and the stack is made without it. The next frame is aligned to the last frame that did align, so one bad frame does not throw off the rest. After the stack, a notice names each frame left out and why, and the Library shows the render's frame count as, for example, "44 of 46". If many frames are left out for moving too far, try the grid search.
Which end of the stack leads
The frame the others are aligned to sets the result's size. If it were the least magnified end of the stack, every other frame would have to be shrunk into it, so when the second frame comes out magnified relative to the first, Deptheos starts again with the frames in reverse order. The most magnified frame then leads, every frame is enlarged into it, and the crop loses nothing. The check is always on, in every app and the command line.
Crop to the area every frame covers
An aligned frame has no picture along some of its edges, where it moved away. With Crop to the area every frame covers on, the default, the result keeps only the area where every frame has picture. With it off, the result keeps the full frame, and toward the edges each spot comes only from the frames that reach it, so the edges can be less sharp.
What alignment can't fix
Alignment moves each frame as a whole. A leg or a leaf that moved on its own, a subject that changed shape, or parallax between near and far parts can't be lined up this way; paint those parts in from one frame (see Retouching). Moving the camera on a physical focus rail introduces more parallax than stepping focus with the lens's own focus ring, especially at high magnification.
Settings and the command line
Settings ▸ Alignment holds the grid search's limits (horizontal and vertical shift, rotation, magnification; 0 turns rotation or magnification off) and Exposure compensation. Leave Exposure compensation off for an ordinary stack: with the exposure fixed, it measures the vignetting and the brightness changes of focusing instead, and darkens the result. Each render records the limits it was made with. On iPhone and iPad, Settings ▸ Alignment has the same four limit sliders and Exposure compensation.
On the command line, --align ecc, grid or
none picks the aligner; --grid-shift-x, --grid-shift-y,
--grid-rotation, --grid-magnification and --grid-brightness (exposure
compensation) set the grid search; --no-crop turns the crop off.
Why frames move
Moving the focus changes a lens's magnification slightly (focus breathing), so the subject grows or shrinks from frame to frame, and a camera on a rail drifts by a fraction of a millimeter. Each step is small, but over a whole stack the steps add up to many pixels.
Show what the stack keeps outlines every aligned frame so far, in its frame's color, and dashes the area inside all of them: what Crop to the area every frame covers keeps. The figure aligns to frame 1; the app leads with the more magnified end of the stack, here the last frame.