Thursday, September 28, 2023

The use of star removal and replacement techniques in astronomical image processing

Star removal and replacement techniques are used in astronomical image processing for several reasons:

Stars can sometimes clutter the image, especially when imaging deep-sky objects. Removing stars allows astronomers to focus on the object of interest without the distraction of surrounding stars. Sometimes the stars are not replaced and the galaxy or nebula can be further processed and studied. Removing stars reveals the details of these structures, allowing for better analysis and interpretation.

Stars contribute to the background 'noise' in an image. By removing the stars, the background noise level can be further reduced, improving the signal-to-noise ratio and enhancing the visibility of faint features. The starless image can be denoised without any adverse effect on the stars.

When an image is stretched to bring out the very faint details, the stars, which are already bright, are likely to become saturated and bloated, thus distracting from the overall image and obscuring the fainter parts of the image such as galaxies or nebulae.

By separating  stars from the other parts of the image, both parts can be processed separately and then, if required, the stars can be blended back into the starless image to produce a result that would not be possible by processing the original starry image alone.

Software has been developed to remove stars from an image. One such program is called StarNet.

StarNet is an artificial neural network (ANN) program originally written by Nikita Misiura in 2019 as a JavaScript plugin for Pixinsight called StarNet++. The Pixinsight developers converted the plug-in from JavaScript to C++. To begin with, Starnet++ had laclustre performance because the neural network had only been trained on a limited data set. However, in 2022 Nikita Misiura released a hugely improved program called StarNet2.

Starnet2 is available cross platform for Windows, macOS and Linux as a Pixinsight plugin. However, it is also available as a Command line tool for all three operating systems.

A plugin has also been written for the Gimp and the command line program works integrally with Siril.

J.J. Teoh has written an unofficial cross platform GUI for working with StarNet2 as a standalone program.

We shall do a walk-through of processing sessions involving the Gimp, Siril and the standalone GUI.

Click on any image to see a closer view

The stacked Eagle nebula image has been loaded into the Gimp and stretched enough so that the nebulosity is visible and the stars are visible but not bloated.


The StarNet filter is selected

The filter is allowed to run

The result is a starless image of the Eagle nebula as a two layer image

The image is flattened and is duplicated along with the starry image

The copy of the starless image is pasted onto the copy of the starry image as a new layer with a blending mode of Subtract.
The image is flattened and saved asa star image with perceptual gamma.

The starless image can then be denoised in software such as Neat Image

The denoised image

The denoised image can then be further stretched


At this stage we can see that there is a substantial gradient across the image.

The image can be loaded into GraXpert

Background sampling points are set, making sure that they avoid the main nebulosity.

The background is calculated 

The gradient has been removed

More stretching is done


A final denoising may be required

The stars are added back by pasting the stars image onto the starless image as a new layer with a blending mode of Screen. The pasted stars layer is manipulated by Curves to give the stars their required contribution to the final image before flattening the image


The final image of the Eagle nebula

Star removal and replacement can be done in Siril

The stacked image is loaded into Siril

A Generalised Hyperbolic Stretch is applied to bring out some of the nebulosity but not overstretching the stars.

In Image processing, Star Processing is selected

StarNet Star Removal is selected with Generate star mask

Star removal in progress

A starless image is produced.

The image can be given a Generalised Hyperbolic Stretch

A background extraction can be carried out to remove the gradient.

Making sure that the background sampling points largely avoid the nebulosity.

The gradient has been removed and noise reduction can be done if required.

The stars can be reconstituted with the left hand control window processing the nebulosity and the right hand window processing the stars. The result can be saved as a reconstituted image.
The reconstitution could have been done at the time of invoking StarNet Star Processing and windows such as those shown above would have been presented. However, it seems preferable to reconstitute the image at a later stage after background extraction  and denoising have been done.

Lastly, it is possible to use the unofficial GUI version of StarNet++ to do a standalone star removal.


Steve Wainwright

No comments:

Post a Comment