Page 1 of 1

Heal Module Use

Posted: Wed Apr 12, 2017 5:33 pm
by Guy
Here are some notes relating to using this module. It is not the only way to use the module and experimentation is encouraged.
Please let me know if anyone sees any errors or has any additional advice they think helpful.
I will update this post as needed.
For an index of similar notes on the other StarTools modules see StarTools Main Window Use.

Heal Module

Purpose:
  • To remove unwanted elements in an image (e.g. satellite trails, stars, scratches, stuck pixels, etc) and replace them with pixels similar to the surrounding pixels.
  • Note: Heal is not well suited for removing noise
Description:
For a general overview see Heal
The Heal module was created to provide a means of substituting unwanted pixels in an neutral way. The elements to remove are indicated by the mask. The Heal algorithm is content aware and is able to synthesise extremely plausible substitution pixels for even the large areas.

Useful Sources
There are a number of useful links in StarTools Links and Tutorials.


The StarTools video tutorial A simple processing workflow tutorial with imperfect real-world data includes the use of the module. This shows v1.5 but is still relevant for this module.
See this description for Removing Satellite trails.
See also this description for Creating a starless image.

The notes below relate to StarTools versions 1.5-1.8

When to use:
  • The Heal Module can only be used when Tracking is Off.
  • It is normally used after most of the processing has been done - after the Tracking has been turned off and Denoise done.
  • Can be used more than once.
Example Workflow (v1.5):
AutoDev-{Band/Lens}-Bin-Crop-Wipe-AutoDev(or Develop)-{As needed: Decon/Sharp/Contrast/HDR/Flux/Life}-Color-{Filter}-Denoise-{If needed: Layer/Magic/Heal/Repair/Synth}
Key: {...} optional modules

Example Workflow (v1.6):
AutoDev-{Band/Lens}-Bin-Crop-Wipe-AutoDev (or Develop)-{Contrast/HDR/Sharp/Decon/Flux/Life}-Color-{Entropy/Filter}-Denoise (or Denoise 2)-{Layer/Shrink/Heal/Repair/Synth/Stereo 3D}
Key: {...} optional modules

Example Workflow (v1.7):

{Compose}-AutoDev-{Lens}-Bin-Crop-Wipe-AutoDev (or FilmDev)-{Contrast/HDR/Sharp/Decon/Flux}-Color-{Shrink/Filter/Entropy/SuperStr}-Track/NR-{Layer/Heal/Repair/Synth/Stereo 3D}
Key: {...} optional modules

Example Workflow (v1.8):

{Compose}-AutoDev-{Lens}-Bin-Crop-Wipe-AutoDev (or FilmDev)-{Contrast/HDR/Sharp/SVDecon}-Color-{Shrink/Filter/Entropy/SuperStr/NBAccent/}-Track/NR(Unified-Denoise)-{Flux/Repair/Heal/Layer/Synth/Stereo 3D}
Key: {...} optional modules

Method:
There are many variations in using the Heal module. Here is a common process to remove unwanted elements.
  1. Open the Heal module.
  2. Create a mask highlighting the elements to be removed.
  3. Set 'New Must be Darker Than' as needed
  4. Set 'Grow Mask' as needed to replace pixels around the elements to be removed.
  5. Set 'New Darker Than Old' to Yes.
  6. 'Keep' the result when finished.
What result to look for:
  • Ensure elements to be removed are completely gone.
  • Ensure the replaced pixels look natural and are not too bright (or dim) - set 'New Must be Darker Than' value to adjust.
  • Ensure the area around the removed elements don't have a halo.
  • Make sure you don't have star 'doughnuts' - if so, grow the mask a bit to select more pixels and then retry.
Ways of getting better results:
  • If using the Heal module to remove elements such as satellite trails try stacking with a different stacking algorithm - such as median or sigma stacking, or some other outlier rejection stacking algorithm.
  • If possible, avoid using the Heal module by removing the problem earlier on in processing - for example - by discarding bad sub-frames.
After Use:
  • Consider using other modules that require Tracking to be off - like Magic, Repair and Synth.
Special Techniques:

Using the Heal module to remove satellite trails
See also the description in the topic Lens flare and artifact removal.
  1. Open the Heal module.
  2. Create a mask for the satellite trail by Clearing the mask and using the 'Line Toggle (Click & Drag)' Brush Mode and clicking the start and end of the trail.
  3. Click 'Grow' a few times until the green line covers the whole trail.
  4. 'Keep' the result.
  5. Set 'New Must be Darker Than' to 30%.
  6. Set 'Grow Mask' to 3 or so as needed.
  7. Set 'New Darker Than Old' to Yes.
  8. Keep other settings at default Values.
  9. The trail will be removed. 'Keep' the result when you are happy with it.
Creating a Starless Image
See also the description in the topic Creating a starless image.
  1. Launch the Heal module.
  2. Create a mask for the stars - Mask-Auto-Stars-Do.
    • If the mask picks up details that are not stars - in 'Auto', adjust 'Filter Sensitivity' as needed (Note: lower values are more sensitive - i.e. more features detected).
    • If the mask picks up detail which is in a particular colour channel you can ignore that channel. To do this - in 'Auto', adjust 'Exclude Color' to stop selection of elements of that colour channel (channels are - Red, Blue, Yellow (Red + Green) and Purple (Red+Blue)).
    • Manually adjust the mask to remove any remaining masking of non-stars.
    • When you are happy with the mask 'Keep' it - we are then back in the Heal module.
  3. Set 'New Darker Than Old' to 'Yes'.
  4. Set 'Grow Mask' as needed to ensure all pixels are masked.
  5. The Heal module should remove the masked stars with all other settings at their default values.
  6. Go back and adjust the mask if there are outstanding stars or star halos.
  7. 'Keep' the result when you are happy with it.
Using the Heal module to process stars independently
See also the description Using Heal to process stars and background independently.
  1. Create a starless image as described above.
    • 'Keep' the starless background image when you are happy with it.
    • Save the starless image for use later.
  2. Create a stars-only image:
    • Launch the 'Layer' module.
    • Click the preset 'Undo->Bg' - this sets the background (left panel) to what is in the undo buffer - which is the original image.
    • Set the 'Layer Mode' to 'Subtract' - and the result (right panel) is the extracted stars.
    • 'Keep' the resulting stars-only image.
    • Save the stars-only image - we will need it later.
  3. Process the starless image:
    • Click 'Undo' - reverts to the image before the last modules' changes - to restore the starless image.
    • Process the starless image as you want (e.g. Sharp, Life, Denoise, HDR etc.) until you are happy with it.
  4. Merge the stars back in:
    • Launch the 'Layer' module - This loads the starless image in the foreground (centre panel).
    • Click 'Open' and select the saved stars-only image - This will load into the foreground (centre panel) and the starless image becomes the background (left panel).
    • Set the 'Layer Mode' to 'Add'.
    • The resulting merged image is in the right panel.
    • Click 'Keep' to keep the merged image.
Description of Controls:

Mask:
For general instructions on using mask see Mask.
  • Mask areas which need to be healed.
  • Set 'Grow Mask' as needed to ensure all pixels are masked.
New Must Be Darker Than
Sets the maximum value of new pixels (as a percentage of full white).
  • This is useful when the Heal algorithm generates elements that look like stars. By putting a cap on the maximum brightness these elements will not be mistaken for stars.
  • Adjust this if the replacement pixels are too bright.
  • Default value is 0% (Pure Black). Range is 0% to 100% (Off).
Grow Mask
Temporarily grows the mask - like pressing the 'Grow' button the set number of times.
  • Default value is 0 pixels. Range is 0 to 10 pixels.
  • Set Grow Mask as needed to ensure all pixels are masked.
  • A value of 2-3 is normally all that is needed.
Quality
Sets the quality with which the new pixels are rendered. Higher quality settings give marginally better results but are slower.
  • Low
  • Medium
  • High
  • Ultra
  • Default value is Medium.
Neighbourhood Area
Sets the size of the local area where the algorithm can look for good candidate seed pixels.
  • Default value is 200 pixels. Range 0 pixels to the image size.
Neighbourhood Samples
For a large area being healed using seed samples avoid repeating patterns. Leaving it to 0 means the heal algorithm will not use any seed samples.
  • Default value is 0. Range 0 to 500.
New Darker Than Old
Sets whether any new pixels created must be darker than the ones they replace.
This setting makes it possible to subtract the healed image from the original image.
  • Yes
  • No
  • Default value is No.
  • Set to Yes if creating a starless image or processing stars separately - as described in the Special Techniques section.
Background Notes

Removing Star Trails in Comet Images
If you want to replace the star trails in an image of a comet with point stars you can use the Heal module.
  1. Take a sequence of comet images for stacking.
  2. Stack the comet images - using the comet as the alignment point. Use sigma clipping removes some if not all the stars. This gives the clear image of the comet with blurred (or reduced) stars.
  3. Re-stack using the stars as the alignment points. Use sigma clipping to reduce the comet. This gives a clear image of the stars with a fainter blurred image of the comet.
  4. Create a completely starless image using the clear comet image - as described in 'Creating a Starless Image' above.
    • 'Keep' the comet-only image when you are happy with it.
  5. Create a stars-only image:
    • Launch the 'Layer' module.
    • Click the preset 'Undo->Bg' - this sets the background (left panel) to what is in the undo buffer - which is the original image.
    • Set the 'Layer Mode' to 'Subtract' - and the result (right panel) is the extracted stars.
    • 'Keep' the resulting stars-only image.
    • Save the stars-only image - we will need it later.
  6. Process the comet image:
    • Load the comet image.
    • Process the starless comet image as you want (e.g. Sharp, Life, Denoise, HDR etc.) until you are happy with it.
  7. Merge the stars back in:
    • Launch the 'Layer' module - This loads the comet image in the foreground (centre panel).
    • Click 'Open' and select the saved stars-only image - This will load into the foreground (centre panel) and the comet image becomes the background (left panel).
    • Set the 'Layer Mode' to 'Add'.
    • The resulting merged image is in the right panel.
    • Click 'Keep' to keep the merged image.
You should end up with an image where the comet is clear and in focus and so are the background stars.

A variation of this is to take an image of the stars with a shorter duration and use this as the basis for the stars-only image. This will reduce the brightness of the background stars and so highlight the comet.