Author Topic: How to "remove" stars from image using PI?  (Read 23149 times)

Offline Yuriy Toropin

  • PixInsight Addict
  • ***
  • Posts: 209
How to "remove" stars from image using PI?
« on: 2010 January 25 04:55:38 »
Hi,

are there some approach or trick that will allow to filter out (remove, delete) stars from image using PI?
What processes and how could be used for this?

The value of star removal is that you can apply more aggressive processing on remaining part of the image, usually, nebulae, stretch them more agressively. Example is below, this is very dim but large planetary nebulae PK 219+31.1 (RGB, 4x20min in each channel).

The first image is a result of convinient processing in PI, nebulae is hard to detect


And this is result of "extreme" stretching of channels after stars were removed. In general, method described here (see Tone Mapping presentation) was use.


There are some other application of the same technique, it's simply interesting to check shape of object (nebulae, galaxy) on image where stars were removed. As example let me show "starless" version of M31 shot (data acquisition - by tomato from Russian astroforum, all processing is mine mostly in PI except of stars removal).



So - any ideas how to remove stars in PI?
Or, alternatively, selectively enchance mid- and large-scales details (probably, wavelets could be of some help here?)
« Last Edit: 2010 January 25 05:10:11 by Yuriy Toropin »

Offline dhalliday

  • PixInsight Old Hand
  • ****
  • Posts: 307
    • on Flickr
Re: How to "remove" stars from image using PI?
« Reply #1 on: 2010 January 25 05:06:30 »
Yuriy
Wow nice M31...!
What about "star mask"...?
It does not work so great...
I asked this same question a few months ago...cannot say I got a clear answer...(!)
So I am going to see what folks say...It is a pretty important part of IP... >:D

Dave
Dave Halliday
8" Newtonian/Vixen VC200L/ TV 101,etc etc
SSAG/EQ6
CGE Pro
SBIG ST2K,ST10XME

Offline Yuriy Toropin

  • PixInsight Addict
  • ***
  • Posts: 209
Re: How to "remove" stars from image using PI?
« Reply #2 on: 2010 January 25 05:24:23 »
Yes, "careful" separation of "stars" from mid- and large-scale features and background sometimes is very useful step.

BTW, here is M31 with stars for comparison (data acquisition - tomato, postprocessing is mine in PI).

Offline dhalliday

  • PixInsight Old Hand
  • ****
  • Posts: 307
    • on Flickr
Re: How to "remove" stars from image using PI?
« Reply #3 on: 2010 January 25 05:36:09 »
Well...it looks better WITH the stars...not dark enough for my tastes...
ANYWAYS...we are talking (really) about ISOLATING the stars...
At least this is what I want...
I want a separate image (?"mask") that CONTAINS the stars...
So I apply it to work on the nebula...or I use it to work on the stars (color) etc...
Is this what  you are driving at...or is it more to "get them out of the way" so you can do nasty things to the rest of the image...?
There is a tutorial (?by Juan) talking about splitting the image into;
stars
sky
nebular areas

Have you seen it...don't have the link handy..
Some "wavelet voodoo" was used but it was over my head... >:D

Dave
Dave Halliday
8" Newtonian/Vixen VC200L/ TV 101,etc etc
SSAG/EQ6
CGE Pro
SBIG ST2K,ST10XME

Offline Yuriy Toropin

  • PixInsight Addict
  • ***
  • Posts: 209
Re: How to "remove" stars from image using PI?
« Reply #4 on: 2010 January 25 06:32:40 »
Is this what  you are driving at...or is it more to "get them out of the way" so you can do nasty things to the rest of the image...?
There is a tutorial (?by Juan) talking about splitting the image into;
stars
sky
nebular areas

Have you seen it...don't have the link handy..
Some "wavelet voodoo" was used but it was over my head... >:D
Hi Dave, I'm talking about something like this.
I would like to remove stars from the image with the minimum level of artifacts remaining.
After that by subtracting "startless" image from the initial one, I will get image with stars only.
And I will be able to proceed nebulae along, and stars alone.

Could you (or somebody else) point to that tutorial mentioned?

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • PegasusAstronomy.com & Starshadows.com
Re: How to "remove" stars from image using PI?
« Reply #5 on: 2010 January 25 07:58:05 »
Applying an inverse star mask is  not adequate?
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
Re: How to "remove" stars from image using PI?
« Reply #6 on: 2010 January 25 08:40:47 »
Yes, think it would better to mask the stars than blur the data. 

Still, It would be a useful demonstration to see how of PI could do this.

I think there would be away to replace the star mask data with a median of sounding pixels.

Max

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: How to "remove" stars from image using PI?
« Reply #7 on: 2010 January 25 09:48:34 »
Hi,
how about trying "Morphological Transform: Erosion". If you use a star mask, you should be able to protect most of the non-star structures. Attached the result without using a star mask.

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline avastro

  • PixInsight Addict
  • ***
  • Posts: 181
    • http://astrosurf.com/avastro/
Re: How to "remove" stars from image using PI?
« Reply #8 on: 2010 January 25 10:00:57 »
Hi,
To apply some process in an image with faint large structures, I first use the script in utilities "extractwaveletlayers" depending on the image I select 5 or more layers, then I select the layers with the structures I would like to enhance, apply HDRW transform, a curve,or a histogram... to the taste.
Then I reassemble the layers using PixelMath with rescaling result ticked.
This process generally give me good results, need to saturate a little bit the color after this process.
Removing the stars and later in the process reassembling it with the subtracted image give me some artifacts mainly around the stars.
Masking the stars with a good mask usually work rather well.

Cheers

Antoine
Antoine
Lentin Observatory
http://www.astrosurf.com/avastro/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: How to "remove" stars from image using PI?
« Reply #9 on: 2010 January 25 11:28:07 »
Hi,

here is my attempt at doing it with star masks:
- copy the image
- create star mask with Star Mark Generator on original
- apply mask to original
- do Morphological Transform: Morphological Selection with Size=7 on copy of image. This creates an unsharp version of the original where stars are substituted by surrounding pixels
- do Pixel Math with copy of image as source to the masked original. This copies the replacement pixels to the star locations while not touching the galaxy pixels

Result and process screenshot attached below. I think you can get an even better result with some additional experimentation on the parameters.

Georg

Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: How to "remove" stars from image using PI?
« Reply #10 on: 2010 January 25 11:29:05 »
here is my attempt at doing it with star masks:

And here the process parameters screenshot...
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Yuriy Toropin

  • PixInsight Addict
  • ***
  • Posts: 209
Re: How to "remove" stars from image using PI?
« Reply #11 on: 2010 January 25 12:20:34 »
... how about trying "Morphological Transform: Erosion". If you use a star mask, you should be able to protect most of the non-star structures. ...
George, thanks a lot for your suggestion!

Quite honestly, I've never before tried that Morphological Transform process.
I was able to remove majority of stars with its help (and with star mask), looks like additional practicing can improve results a little bit.
Nonetheless, some artefacts from the brightest stars are still there...

BTW, Morphological Transform thing looks really outdated. And the worst thing - I have no idea how to handle it in systematic way, no help, no manual for it...  :(

Hi,
To apply some process in an image with faint large structures, I first use the script in utilities "extractwaveletlayers" depending on the image I select 5 or more layers, then I select the layers with the structures I would like to enhance, apply HDRW transform, a curve,or a histogram...

Antoine, thanks a lot for your suggestion, I will also try it.

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: How to "remove" stars from image using PI?
« Reply #12 on: 2010 January 26 09:49:56 »
Hi,

actually, the process can be slightly simplified by applying the morphological transform directly to the masked image:
- create star mask with Star Mark Generator on original
- apply mask to original
- do Morphological Transform on original

I guess you will never get the quality of a manual star removal. But at least stars are reduced a little bit, without loosing too much detail on the galaxy.

BTW: Does anybody know how the "Dust & Scratches" Photoshop filter used in the original tone mapping presentation works? I think it must be something similar to morphological transform.

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
Re: How to "remove" stars from image using PI?
« Reply #13 on: 2014 April 10 17:59:48 »
Four years later, I'm now at NEAIC listening to the Tone Mapping 2.0 talk by J-P Metsavainio of Astro Anarchy fame. He's doing all of these steps in PS, and I'm trying to adapt them for PixInsight. I've used the star mask and morphological to get a similar effect, but whatever PS's Dust and Scratches is doing, it's getting rid of the stars better.

The ultimate goal is to simply separate DSO from stars and process them separately before recombining. PixInsight's Range Selection is amazing at this for DSOs AND bright areas, but I don't have a good way of using PixelMath or something to do a full separation. Old Wexi, are you around?  :D  I feel like you covered something like this in one of your tutorials...

Offline Alejandro Tombolini

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1267
    • Próxima Sur
Re: How to "remove" stars from image using PI?
« Reply #14 on: 2014 April 10 18:21:35 »
HI Josh

May be this example can be usefull.

Saludos, Alejandro.