Multi-Point Registration and Stacking

Multi-point registration and stacking was introduced in Siril 1.5. This is an advanced registration method suitable for planetary videos. Initially worked on with the support of Rolf Hempel (the author of PlanetarySystemStacker), the code lay dormant from the 0.9 release cycle before later being reworked to become a mature feature. The process is split into a registration stage and a stacking stage, following the usual Siril workflow and using the customary GUI tabs.

Multi-Point Registration

This method is selected in the same way as other registration methods, using the dropdown in the Registration tab. Selecting the method shows the relevant parameters.

Multi-point registration settings

Parameters

Registration channel: this parameter is ignored for this method: registration is conducted against a luminance reference frame.

Half-box width: this parameter sets the half-width of the alignment point box. AP spacing is derived from this. In the case of noisy images or low local contrast, a larger half-box width is recommended.

AP search width: this sets the local per-AP shift search radius between adjacent frames. If no match is found within this distance, the search fails and the AP offset is set to zero.

Global search width: this sets the global alignment search radius between adjacent frames. This is the maximum shift allowed between consecutive frames. If no match is found within this search width, frame alignment is aborted. Tn that case you can try a higher value (up to 150) for this parameter or, often better, pre-register the video using the Kombat registration method and ensure Seed from existing registration is enabled (see below).

Min brightness: this sets the minimum brightness for AP auto-placement on an 0-255 8-bit scale. If processing a 16-bit video this value will be auto-scaled to 16-bit 0-65535 range. This parameter avoids AP placement in the sky background.

Min contrast: minimum (max - min) over an AP box. APs below this contrast are rejected. 0-255 scale.

Min structure: normalized gradient magnitude minimum (0-1 range). APs with weaker structure are rejected. Increase this threshold if APs with too little structure have been created.

AVI Bayer pattern: this widget is only shown when the loaded sequence is an AVI (film) container. AVI files carry no colour-filter (Bayer) marker, so Siril cannot tell a mono video from a one-shot-colour one. Auto lets Siril guess; None (mono) forces mono treatment; the four Bayer values (RGGB, BGGR, GBRG, GRBG) mark the video as raw one-shot-colour with that filter pattern, so it is debayered to colour before stacking. This hint is ignored for SER and FITS sequences, which carry their own Bayer metadata.

Reference frame %: sets the percentage of frames to stack to produce the reference frame.

Object is changing fast: Set this for objects that change during the sequence (e.g. Jupiter or the Sun) to generate the reference frame from as short a region of the sequence as possible: where the object is rotating or changing fast, this can improve the sharpness of the reference frame. For non-fast moving images, disabling this will allow selection of the best frames from the full duration of the sequence when creating the reference frame.

Register percent: sets the percentage of the best frames each AP ranks and computes shifts for during registration, per AP. This is an upper bound on the Stack percent exposed in the Stacking tab: you can lower the percentage at stack time but not raise it beyond this value without re-registering. Lower it only to save compute (and shrink the sidecar) when you already know you will not stack more than this fraction. The default is 100% (register every frame). Note that this does not globally cull bad frames, as bad frames may still contain regions of clarity around some APs.

Alignment mode: sets the global frame alignment mode. When a sequence is loaded Siril inspects the first frame and pre-selects a sensible default, but you can override it. The options are:

  • Planet (disc): the default. Aligns on the brightness centroid - fast and robust for a full planetary disc (including Saturn) against a dark background.

  • Surface (detail): correlates an auto-picked detail patch. This will work for planetary discs but is slower and potentially less robust to videos with larger jumps between frames; it is ideally suited for surfaces such as lunar or solar details where full-disc alignment cannot work.

Seed from existing registration: Where the image moves significantly between frames, Surface (detail) global alignment may struggle as it correlates detail within a limited distance. If you are unsure if your frames might move by a more significant amount it is recommended to pre-apply a different registration method to eliminate the gross shifts. Kombat works well for this, being fast and pixel-accurate. If registration data is available for the sequence and this option is active, the registration shifts will be used to seed the global alignment. It is not required for Planet (disc) mode as this is already frame-global. If the option is disabled, registration data will be ignored; if no registration data exists, the option will have no effect but will not generate an error. The default is enabled (seed with registration data if available)

Tip

Note that only shift information is taken from registration data - other aspects of affine or homographic alignment are ignored.

Apply per-AP shifts: When off, all APs use the same single best-frame shift instead of per-AP shifts. The default is on and this should not normally be changes as per-AP shifts is the whole point of this registration method.

Brightness-normalize quality: divide per-frame Laplacian quality by mean above-threshold brightness for invariance to varying exposure. This is recommended in cases where the atmospheric transparency varied but is always safe and therefore should generally be left at the default (enabled).

Analyze

Once the parameters are set the Analyze button automatically places Alignment Points (APs) and computes the global shifts between frames and analyzes local AP quality using a Laplacian metric. It then composes and displays a luminance reference frame.

Tip

Don't worry if you opened the sequence with Debayer enabled and it has now become mono - this is because the reference frame is based on luminance only.

Tip

For typical Bayer-pattern planetary sequences you don't need to worry about the Debayer option in the Convert tab / File Open dialog. The sequence must be debayered for local AP analysis but this is done automatcally regardless of the setting.

After analysis the AP grid is shown. You can use the Edit APs button to open a dialog to edit APs: they can be added by clicking, deleted by right clicking or dragged with the mouse, or you can change the AP size and re-do automatic AP placement.

Multi-point AP editor

The AP editor allows adjustment of the AP half-box width and minimum brightness, contrast and structure settings. The current number of APs is shown, as well as a handy guide to how to add, delete and move APs.

The Auto-place button allows to redo the auto-placement of APs. Note this will remove any custom APs you have set. The Clear button allows clearing all APs.

The Show stacking patches button toggles visibility of the full patches used in stacking. (By default, only the correlation boxes are shown, but the full patches extend beyond the correlation boxes in order to allow for blending.)

While the AP editor dialog is open, clicking an AP highlights it and allows its size to be changed individually. This enables tailoring the size of APs to the level of detail / contrast. To change the size of a selected AP the mouse scroll wheel or the + / - keys can be used. APs can also be dragged to move them to a different place in the image. Right-click will delete a selected AP.

Changes to AP size and position, additions and deletions can be undone / redone using the Undo / Redo buttons or Ctrl-Z / Ctrl-Y shortcuts, which are overrridden while the AP Editor dialog is open. Note that the undo history is lost when the AP Editor is closed.

Registration

When you are happy with the APs you can return to the Registration tab and click Go Register. This can be an intensive process if the sequence is large, so now may be a good time to make a cup of tea. Registration will produce a 'sidecar' - a data file describing the APs, quality and local shifts - which will be used during stacking.

If you have altered the initial auto-placed APs then registration will automatically redo the analysis stage to account for the updated APs.

When this is complete the View Shifts button will be sensitive.

Multi-point AP shift viewer

This tool allows you to view the per-AP, per-frame shifts computed relative to the reference frame. Successfully computed shifts are shown as a green arrow; if it was not possible to compute the shift for an AP it is shown with a red dot. By default such an AP is treated as having zero shift (the coarse global estimate) for stacking purposes; enabling Skip failed AP shifts in the Stacking tab instead drops these failed contributions, which can remove ghosting at the cost of fewer frames contributing there. The Frame widget allows stepping through frames in the sequence, and the Vector scale (x) widget allows multiplying the length of the shift visualization arrows, which may help with visualizing small shifts.

Frame Culling

There are two ways to limit the frames that contribute to stacking: global frame culling and per-AP culling. Each is described below: generally, per-AP culling is recommended as even mostly bad frames may contain areas of higher quality.

Global frame culling is achieved in the usual way: at any stage you can deselect frames using the frame browser or the Plot tab, and then select "selected frames only" in the Image Selection dropdowns in the Registration or Stacking tabs. This may occasionally be useful to deselect completely unusable frames, such as ones with USB transmission defects or aeroplane fly-throughs where the frame-to-frame global shift cannot be computed.

Per-AP frame culling has already been described above. The Registration tab sets a Register percent (the upper bound of frames ranked per AP) and the Stacking tab sets a Stack percent (the frames actually blended per AP). The latter is capped by the former: you may wish to register 100% of frames per AP but then reduce the stack percent in the stacking tab - this way round is fine, but you cannot increase the stack percent in the stacking tab beyond the register percent you set when registering the sequence without re-registering.

Multi-Point Stacking

This method is specifically intended for use with the multi-point registration method and will not work without a valid multi-point sidecar. The method is selected in the Stacking methods dropdown in the Stacking tab. If a sequence has a valid multipoint sidecar, multi-point stacking will automatically be proposed as the default stacking method when accessing the Stacking tab.

Multi-point stacking interface

Stacking parameters

Normalization methods do not apply to multi-point stacking, and the relevant widgets are not sensitive when this stacking method is selected.

Scale: This dropdown sets the scale of the stack, with the choices 1x, 1.5x, 2x and 3x. When a value greater than 1x is selected each frame is upscaled using OpenCV interpolation before contribution to the upscaled stack buffer. This is similar to the old "Simplified Drizzle" method provided for deep-sky stacking.

Stack percent: sets the percentage of the best frames to blend per AP. This is capped by the Register percent set in the Registration tab: you cannot stack more frames than were registered without re-running registration.

Stack frames: sets an absolute number of the best frames per AP to stack. If -1 this is ignored; if positive, this overrides Stack percent (still capped at what was registered).

Background fraction: Decides full-frame vs patch-based background composition.

Background blend: Controls the soft fg/bg blend ramp.

Skip failed AP shifts: When enabled, (frame, AP) contributions whose local shift measurement failed are dropped instead of being stacked at the coarse global estimate. This helps when ghosted or doubled patches appear in the stack. APs for which no frame produced a successful measurement are still stacked unfiltered (a misaligned patch is better than a hole). The default is off.

Force 32b output: When enabled, the final stacked image is saved as 32-bit float even if the input frames are 16-bit. The weighted merge is always performed internally in 32-bit float; this option only controls whether the saved result is packed down to 16-bit integer (the default) or kept at full float precision. The default is off.

Image rejection: This provides global culling control. For multipoint- registered sequences, the "all", "selected" and "quality" options may be selected.

Once the desired parameters are set, click Start stacking to generate the stacked image.

How it works

Theory

When you image a planet or the Moon through the atmosphere, turbulence ("seeing") smears the light in a way that changes from moment to moment and from place to place across the frame. At any given instant one region of the disc may be crisp while another is blurred, and a fraction of a second later the situation is reversed. Ordinary stacking aligns and averages whole frames, so it can only ever capture the moments when the entire field happened to be sharp - which is rare. Multi-point stacking instead treats many small regions of the image independently, so each region can be aligned and built from the particular frames in which it was sharpest. This is the same idea used by dedicated planetary stackers such as AutoStakkert! and PlanetarySystemStacker (PSS); this implementation is based on the latter.

The pipeline runs in three stages, which appear in the log as Stage A, Stage B and Stage C. Stages A and B together make up registration: the Analyze button runs Stage A on its own (so you can review and edit the alignment points and see the reference frame before committing to the heavier work), while Go Register runs Stages A and B and writes the sidecar. Stage C is the stacking step, run from the Stacking tab. The pss command runs all three in one go.

Quality ranking (Stage A). Every frame is scored for sharpness. Siril measures local contrast using a Laplacian (an edge-detecting filter): a sharp frame has strong, well-defined detail and therefore a high score, while a blurred frame scores low. The Brightness-normalise quality option divides this score by the frame's brightness so that passing clouds or changing transparency do not masquerade as changes in sharpness.

Global alignment (Stage A). The atmosphere and small mount errors make the target wander around the frame, so Siril first removes this gross, whole-frame motion. In Planet (disc) mode it tracks the brightness centroid of the disc; in Surface (detail) mode it locks onto an automatically chosen patch of surface detail and follows it by cross-correlation. The best few percent of frames (see Reference frame %) are then averaged together to build a clean, low-noise reference frame that the rest of the process measures against.

Alignment points (Stage A). A grid of small alignment points (APs) is laid over the reference frame. Each AP is a little box anchored on a piece of detail. Points that fall on dark sky, flat low-contrast areas or featureless regions are discarded (this is what the Min brightness, Min contrast and Min structure thresholds control), because there is nothing there to align to. You can also adjust this grid by hand in the AP editor.

Local per-AP shifts (Stage B). This is the heart of the method, and the step that Go Register adds on top of Stage A. For every alignment point and every frame, Siril searches a small neighbourhood around the point to find where that patch of detail has drifted to in that particular frame. The result is a dense map of tiny, local shifts that describes how the seeing warped each frame differently in each region - something a single global alignment cannot represent. Stage B also scores each frame's quality separately at each alignment point, so the stack can later pick the best frames region by region. The search radius is set by AP search width, and the per-point shifts can be inspected with the shift viewer. All of this is saved to the sidecar so it can be reused at stacking time without recomputing.

Stacking (Stage C). Finally the image is rebuilt region by region. For each alignment point Siril keeps only its sharpest frames (Stack percent / Stack frames), using the per-AP quality scores from Stage B, nudges each patch into place using its measured local shift, and averages them. Neighbouring patches overlap and are blended together where they meet; areas not covered by any AP are filled from a separately composed background. The averaging is carried out in floating point for precision and the result is written out at the chosen bit depth. The measures that keep these overlapping patches from showing as a grid are described next.

Keeping the patchwork invisible (Stage C). Rebuilding an image from hundreds of small, independently chosen patches risks leaving the alignment-point grid visible as blocks, seams or shading steps. Several measures guard against this:

  • Soft frame selection. Rather than a hard cut at the chosen percentage, frames whose quality falls near the cutoff are faded out with a smooth (raised-cosine) weight instead of being dropped abruptly. The width of this fade adapts to how much a frame's quality ranking wobbles between neighbouring points, so a borderline frame contributes almost equally to adjacent APs - it cannot be used in one patch but not its neighbour and so print the grid. (At 100 % per-AP selection, or when an exact Stack frames count is requested, no taper is applied.)

  • Feathered (Hann) blending. Each patch is blended into the mosaic through a smooth raised-cosine window that fades to nothing at its edges, so overlapping patches cross-fade seamlessly with no hard boundary or crease at the joins.

  • Sub-pixel placement. Patches are shifted into position to a fraction of a pixel rather than snapped to the nearest whole pixel, avoiding a jagged, aliased look and a small fixed-pattern bias.

  • Brightness matching. Each frame is first scaled to a common brightness so that transparency changes do not show, and neighbouring patches - which average different sets of frames - have their levels equalised over the region they share, removing the faint block-shading that those level differences would otherwise leave behind.

The Skip failed AP shifts option (see above) is a further safeguard, discarding patch contributions whose local alignment could not be measured rather than letting them blur or ghost the result.

The pay-off is an image that is sharper and less noisy than any single frame, because every part of it is assembled from the brief moments of good seeing local to that part.

Siril command line

pss seqname [-out=file] [-scale=N (1.0..3.0)] [-stack-percent=N] [-stack-frames=N] [-bg-fraction=F] [-bg-blend=F] [-skip-failed-aps] [-align={planet|surface}] [-half-box=N] [-search-width=N] [-search-global=N] [-register-percent=N] [-ref-percent=N] [-fast-changing] [-min-brightness=N] [-min-contrast=N] [-min-structure=F] [-no-shifts] [-no-normalize] [-noseed] [-avi-bayer={auto|none|rggb|bggr|gbrg|grbg}]
Runs the PlanetarySystemStacker (PSS) multipoint registration and stacking pipeline on the given sequence with sensible defaults. Frames are ranked by Laplace-sigma quality, globally aligned, covered with an alignment-point grid, locally shifted per-AP and stacked with PSS-style weighted blending. Bayer SERs are debayered on open regardless of the saved preference. For a two-step workflow that lets you persist registration results, use REGISTER_MPP followed by STACK_MPP instead.

Output scaling via -scale=N (1.0..3.0, fractional allowed): 1.0 stacks at native resolution; larger values upscale during the stack via cv::resize interpolation. CFA inputs are auto-debayered first.

Register-side flags: -align={planet|surface} (default planet: brightness-centroid alignment for a full disc on a dark background; surface correlates an auto-picked detail patch, e.g. Moon/Sun), -half-box=N (24), -search-width=N (14), -search-global=N (34), -fast-changing (build the reference from a short interval; off by default), -ref-percent=N (5; %% of frames averaged into the reference), -register-percent=N (100; per-AP frame cap baked at registration — set it at least as high as the largest stack percent you'll want, lower only to save compute), -min-brightness=N (10), -min-contrast=N (0), -min-structure=F (0.04), -no-shifts, -no-normalize, -noseed (disable seeding global alignment from existing registration data), -avi-bayer={auto|none|rggb|bggr|gbrg|grbg} (Bayer-pattern hint, consulted only for AVI inputs).

Stack-side flags: -stack-percent=N (100; per-AP frames to blend, capped at the register percent), -stack-frames=N (overrides percent), -bg-fraction=F (0.3), -bg-blend=F (0.2), -skip-failed-aps (drop frame/alignment-point pairs whose local shift measurement failed instead of stacking them at the coarse estimate; alignment points with no successful measurement at all are stacked unfiltered), -out=file (default: seqname_stacked.fit).

Frame selection is automatic: frames excluded in the frame selector are kept out of analysis and the stack — there is no -selected flag.

Siril command line

register_mpp seqname [-align={planet|surface}] [-half-box=N] [-search-width=N] [-search-global=N]
register_mpp seqname ... [-register-percent=N] [-ref-percent=N] [-fast-changing] [-min-brightness=N]
register_mpp seqname ... [-min-contrast=N] [-min-structure=F] [-no-shifts] [-no-normalize] [-noseed]
register_mpp seqname ,,, [-avi-bayer={auto|none|rggb|bggr|gbrg|grbg}]
Runs Stages A and B (analysis and registration) of the multipoint pipeline: ranks frames by Laplace-sigma quality, globally aligns them, places an alignment-point grid on an average reference frame, and computes per-AP per-frame shifts. Results are persisted as a seqname.mpp sidecar in the current working directory; STACK_MPP consumes the sidecar to produce the final stacked image. Bayer SERs are debayered on open regardless of the saved preference.

Flags: -align={planet|surface} (default planet: brightness-centroid alignment for a full disc on a dark background; surface correlates an auto-picked detail patch, e.g. Moon/Sun), -half-box=N (24), -search-width=N (14), -search-global=N (34), -fast-changing (build the reference from a short interval; off by default), -ref-percent=N (5; %% of frames averaged into the reference), -register-percent=N (100; per-AP frame cap baked at registration — set it at least as high as the largest stack percent you'll want, lower only to save compute), -min-brightness=N (10), -min-contrast=N (0), -min-structure=F (0.04), -no-shifts, -no-normalize, -noseed (disable seeding global alignment from existing registration data), -avi-bayer={auto|none|rggb|bggr|gbrg|grbg} (Bayer-pattern hint, consulted only for AVI inputs).

Frame selection is automatic: frames excluded in the frame selector are kept out of the reference frame, AP placement and ranking — there is no -selected flag.

For a one-step register-and-stack equivalent see PSS

Links: stack_mpp

Siril command line

stack_mpp seqname [-out=file] [-scale=N (1.0..3.0)] [-stack-percent=N] [-stack-frames=N] [-bg-fraction=F] [-bg-blend=F] [-skip-failed-aps]
Consumes the seqname.mpp sidecar produced by REGISTER_MPP and runs Stage C (stacking) of the multipoint pipeline: per-frame brightness equalisation, cv::resize upscale (when scaling), per-AP remap into per-AP buffers, weighted merge and background composition, then cast to uint16 (or 32-bit float with -32b).

Flags: -out=file (default: seqname_mpp_stacked.fit), -scale=N (1.0..3.0, fractional allowed; overrides the register-time factor; upscaling uses cv::resize interpolation), -stack-percent=N (100; per-AP frames to blend, capped at the register percent), -stack-frames=N (overrides percent), -bg-fraction=F (0.3), -bg-blend=F (0.2), -skip-failed-aps (drop frame/alignment-point pairs whose local shift measurement failed instead of stacking them at the coarse estimate), -32b (force the saved image to 32-bit float; the weighted merge always runs internally in 32-bit float and is otherwise packed down to 16-bit integer on save).

Frame selection is automatic: frames excluded in the frame selector are dropped from the stack, including any excluded after registration (those are simply omitted; the per-AP weighting renormalises, so a large selection change is best followed by re-running REGISTER_MPP). There is no -selected flag.