Author Topic: Star Removal Using StarMask and DefectMap  (Read 13127 times)

Offline Salvatore Giambruno

  • Newcomer
  • Posts: 33
Star Removal Using StarMask and DefectMap
« on: 2017 November 07 21:04:58 »
I'm not sure if this technique has been covered by anyone before or if I am a the first, but a brief search of this forum and Google turn up nothing as far as I can tell, so I thought I'd share it here in any case.

Briefly, you create a good star mask from your final image (or any of its derivations) using the StarMask process (or by whatever method you prefer), invert the resulting star mask (stars to black), then use that star mask as a map in the DefectMap process to and apply it to the image. 

This technique works VERY well and results in very little degradation to image detail.  The larger stars usually require additional touch-up because as a large "defect" they are replaced with a wide average of the background which is apparent even after the application of the star removal process.

The key to using this technique effectively is to create an accurate star mask to begin with.  If one mask doesn't remove all the stars, simply create another star mask at the scale required to get all the stars you need at a particular scale.





--Sal

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Star Removal Using StarMask and DefectMap
« Reply #1 on: 2017 November 08 10:02:06 »
very interesting technique! i will have to try this out.

thanks for sharing that.

rob

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Star Removal Using StarMask and DefectMap
« Reply #2 on: 2017 November 08 12:12:25 »
Hi Salvatore!
Interesting idea. Thanks for sharing it.
It took me some time to get the mask working as expected.
Couldnt get such a clean image as you got. Will have to test the variations of masks...

Did you do more than one step by using different masks?
See attached my try with linear image to get the stars removed from the molecular clouds.
But could not get the large stars proper removed.
Any tricks from your side for this available?


Gerald

Offline starhopper

  • Member
  • *
  • Posts: 55
    • starhopper
Re: Star Removal Using StarMask and DefectMap
« Reply #3 on: 2017 November 08 13:26:35 »
Thanks Salvatore for sharing this
Thomas Jäger
https://www.starhopper.eu
12"f/3.8 & 8"f/2.9 Astrograph
SBIG STL11000M, Moravian G2 8300
Vixen Atlux Mount, Skywatcher AZ-EQ6 GT
Skywatcher Esprit 100/550

Offline mricard

  • Newcomer
  • Posts: 13
Re: Star Removal Using StarMask and DefectMap
« Reply #4 on: 2017 November 08 21:08:12 »
Hi Salvatore,

I had a bit of trouble getting it to work at first but I found that if I had great results when I selected aggregate and binarize when I created my star mask and then binarized  the star mask

thanks for sharing!

Marc

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Star Removal Using StarMask and DefectMap
« Reply #5 on: 2017 November 08 21:17:57 »
yes i have been playing with this and it seems that the blacks really have to be pretty near 0 for the defectmap to do anything. the results were remarkably good when i forced the cores of the stars to be 0.0.

rob

Offline Salvatore Giambruno

  • Newcomer
  • Posts: 33
Re: Star Removal Using StarMask and DefectMap
« Reply #6 on: 2017 November 09 22:23:07 »
I'm happy to see that this technique is proving useful to some.  I've never been so clever as this, and it feels great to have come up with something original that even seasoned pros find useful.  ;D

I did mention in my original post that the trick to getting this technique to work correctly is in getting the mask just right.  And that means getting the stars to be the right size, and BINARIZING your values as Marc has stated.  DefectMap only works with BINARIZED pixels.  A pixel is either BAD (black, zero) or it is is not bad (anything other than zero).

Star masks can be tweaked using whatever techniques you like.  I've used intensity transformations, convolution and morphology tricks to get my masks to work best.  But remember, whatever processes you use, the last process should be a Binarize process.

If the problem with star removal is one of scale, you can always generate multiple masks at different scales and apply the DefectMap several times (I've done this).

Unfortunately, big stars cover a wide area and therefore a DefectMap fix will not be perfect.  Therefore, I believe it is best to remove your stars in the linear state, when stars are as small as possible.

Last but not least, CloneStamp is always a last resort . . .
--Sal

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Star Removal Using StarMask and DefectMap
« Reply #7 on: 2017 November 09 23:25:54 »
i wonder if it makes sense to apply the DefectMask process thru a mask (perhaps a different one with smoother star edges) since all DM can do is treat pixels as good or bad with no "nuance". this might mitigate some of the harsh edges around large stars. need to try.

rob

Offline Salvatore Giambruno

  • Newcomer
  • Posts: 33
Re: Star Removal Using StarMask and DefectMap
« Reply #8 on: 2017 November 10 13:00:48 »
Hi Rob,

That's a great idea.  It's anyone's guess as to how it will work as far as filling in the large space for removed large stars, but I imagine that, at the very least, it will soften the edges of those removals . . .
--Sal

Offline GJL

  • PixInsight Addict
  • ***
  • Posts: 102
Re: Star Removal Using StarMask and DefectMap
« Reply #9 on: 2017 November 11 01:48:09 »
Hi,

by the way, Defect Map. It takes hours to execute this tool, although I have an I7 PC. What´s my fault?

Regards   Gerhard

Offline ngc1535

  • PixInsight Old Hand
  • ****
  • Posts: 326
Re: Star Removal Using StarMask and DefectMap
« Reply #10 on: 2017 November 11 07:17:15 »
Hi Salvatore,

For the past few years Fabian Neyer has been demonstrating a technique of star removal that is based on practices that professionals use. He cites this paper of showing the intragalactic glow between members of the virgo cluster:

http://iopscience.iop.org/article/10.1088/0004-637X/720/1/569/pdf

The technique you demonstrate is something like a first order approximation of the idea. The full technique employs some other clever steps including using MLT to calculate the local sky value of stars at different scales. When you use the defect map, you are only using those pixels that are immediate neighbors to your regions. But varying the scale of MLT you can properly get better sky values (and therefore substitution) for the stars. In addition, and this is really clever- you can create a sky subtracted star images that you blur and then subtract from the real data in order to get rid of stellar halos and the wings of PSFs. This takes care of OldWexi's question.

(on a note of computing, Fabian's technique does not require the computational overhead of what the defect map does by looking at each neighbor pixel.)

I just completed an image that uses Fabian's technique. Below is a version of SH2-68 before and after star removal. (I did not see the black levels the same...just quickly grabbed). If there is interest, I can post my version of this tutorial (I will ask Fabian... but I think it isn't a problem). I added a few variations to Fabian's technique. It is a longer process, but the results are commensurate with the effort.





-adam

Offline avastro

  • PixInsight Addict
  • ***
  • Posts: 181
    • http://astrosurf.com/avastro/
Re: Star Removal Using StarMask and DefectMap
« Reply #11 on: 2017 November 11 09:50:18 »
Hi Adam,
I'm interested to learn your technique to remove the stars using Rudick approach.
regards
Antoine
Antoine
Lentin Observatory
http://www.astrosurf.com/avastro/

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: Star Removal Using StarMask and DefectMap
« Reply #12 on: 2017 November 11 09:59:39 »
+1

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: Star Removal Using StarMask and DefectMap
« Reply #13 on: 2017 November 11 11:59:48 »
+2
Geoff
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline kolec

  • PixInsight Addict
  • ***
  • Posts: 100
Re: Star Removal Using StarMask and DefectMap
« Reply #14 on: 2017 November 11 12:18:28 »
+3
kolec