PixInsight 1.5

The Officially Unofficial Reference Guide

Rev.0.1 – 3/29/2010

Section 12: MaskGeneration


The StarMask process is an excellent tool in PixInsight to build star masks of many types, including deringing supports. StarMask operates by extracting the luminance from the target image (or a duplicate of the image if it's in the grayscale color space) and applying a multiscale algorithm that detects and extracts all image structures within a given range of scales (read sizes). The algorithm is based on the à trous wavelet transform and on a proprietary multiscale morphological transform.

Threshold: This value is used to differentiate between noise and significant structures. Basically, all detected structures below this threshold will be considered noise and set to zero, and the rest will survive as significant structures. Obviously, higher thresholds will include less structures in the mask, and vice versa. Therefore, increase this value to prevent inclusion of noise, and decrease it to include more structures.

Mode: You can select one between four available operation modes:

Scale: This parameter is the number of (dyadic) wavelet layers used to extract image structures. The larger value of Scale, the bigger structures will be included in the generated mask. Always try to set this parameter to the lowest value capable of extracting all required image structures; the range between 4 and 6 wavelet layers (scales from 16 to 64 pixels) covers virtually all deep-sky images.

Growth: Overall growth factor, which controls the final sizes of all detected structures on the mask.

Comp.: Small-scale growth compensation. This is the number of small-scale wavelet layers (from zero to the Scale parameter minus one) for small-scale growth compensation (see next parameter).

Small: Small-scale growth factor. This defines an additional growing procedure applied to the set of small-scale structures defined by the small-scale growth compensation parameter.

Smoothness: This parameter determines the smoothness of all structures in the final mask. If generated with insufficient smoothness, the mask will probably cause edge artifacts due to abrupt transitions between protected and unprotected regions. On the other hand, excessive smoothness may degrade masking performance. In the case of a deringing support, finding a correct value for this parameter is very important. If in doubt, it is preferable to exaggerate smoothness, because the effects of leaving too small of a value are usually much worse.

Aggregate: This parameter defines how individual image structures contribute to the mask construction process. Enable this parameter to generate a mask where structures are gathered by summing their representations on all wavelet layers. This leads to structures whose initial values are more proportional to the relevance of their support in the multiscale pyramid.

Binarize: This parameter defines how the initial set of detected structures is truncated to differentiate the noise from significant structures.

If enabled, the initial set of detected image structures is binarized: all structures below the Threshold parameter value are considered noise and hence removed (set to black), and the rest of structures are set to pure white. Therefore you should enable this parameter to generate a mask where all structures are initially white. In this case, only the smoothness parameter will determine the final brightness of all structures (smaller structures will be dimmer when smoothed).

If disabled, the initial set of detected image structures is truncated: all structures below the Threshold parameter value are considered noise and hence removed (set to black), and the rest of structures are rescaled to occupy the whole range from pure black to pure white. In this case, structures have initial values proportional to their relevance in the multiscale pyramid. Structures that are supported by more wavelet layers will be brighter.

Contours: Enable this option to build a mask based on structure contours. This option involves implicit binarization of all structures before contour detection.

Invert: Invert the mask after it has been generated.

Shadows/Midtones/Highlights: These parameters correspond to a histogram transform that is applied to the target image prior to structure detection and mask generation. In fact, this histogram transform is an important preparatory step in the StarMask algorithm. These parameters have default values of 0.0, 0.5 and 1.0, respectively, which define an identity transformation (no change). However, usually you'll need to apply lower values of the midtones balance parameter, especially working with linear images, mainly for two reasons:

Increasing the Shadows parameter may also help to improve detection slightly; however, if you set it to an excessive value, clipping will occur in the shadows, which will prevent inclusion of dim structures. Generally, the highlights parameter is left with its default 1.0 value.

Truncation: Highlights truncation point. This value, in the range [0,1], is a highlights clipping point applied to the final mask (before multiplying by the Limit parameter, see below). It can be used to force the cores of bright structures to be pure white. Decrease this value to improve protection in the cores of mask structures.

Limit: This value, in the range [0,1], multiplies the whole mask after is has been completed, so it is useful to impose an upper limit for all mask pixels. Many deringing supports generated by structure binarization work better with lows limit values, between 0.1 and 0.5. If mask inversion has been selected, this multiplication will take place before the inversion.

Back to the Index | Copyright Note