Author Topic: Better star reduction  (Read 33524 times)

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Better star reduction
« on: 2010 September 25 13:06:49 »
Hi

After a small conversation with mr newbie dave about star reduction in pixinsight , the usual use of morph transform through a star mask was used and
I do have to agree that stars can become misshaped and do they really reduce in size or do they become just fainter  >:D

So how do we improve , better use of the tool ( advice please ) or do we need a better tool as I would hate to say Photoshop  >:D

Discussion Please

Harry
Harry Page

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Better star reduction
« Reply #1 on: 2010 September 25 13:08:29 »
I agree the stars look fainter, not just smaller. Not always desirable but it does reduce the star intensity effectively.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Better star reduction
« Reply #2 on: 2010 September 25 14:08:48 »
For a first approach, let's discuss this using the MorphologicalTransform only.

Morphological transformations are common operators on image processing, specially in the field of binary images (black or white). The grayscale/color expansion works in the same basis: define a kernel or structuring element, which tells the algorithm the neighbourhood of pixels that will be included; and of course, we define a morphological operation (maximum, minimum, dilation, etc.), and perform the calculations.

So, what happens if we use a minimum filter, with a square 5x5 kernel? (just an example) For every pixel, it looks for the minimum value surrounding it, in the 5x5 box centered at that each particular pixel. At the end, pixels are replaced with that value. If there is a mask, it acts at the end, "merging" with the original image.
From this behavior, it is completely natural (and expected) that stars are dimmed. The only way to avoid this is to create a goos mask, that protects the inner core of them. Also, it does help a bit using other operator, such as median or any percentile lower then 0.5 and greater than 0. If the star's edges aren't soft, these operator will still reduce the star size (and make it softer) but without changing too much the central peak.
Now, the problem sometimes is with the shape, the kernel or structuring element. I prefer to keep it as small as possible, and if needed, perform several iterations. This will produce softer results, and edges will preserve better the shape. 3x3 cross, or 3x3 square work fine. Also, it is a good idea to create a two ways element, with both the cross and box, one at each side. This will average the particular results, and then, preserving better whose circular shapes.

To summarize: Small kernels, with 2 (or more ways, if needed), several iterations, and play with the percentile. Also, refine the mask, to protect the cores.


Other alternatives:
- DefectMap: Basically, this process implements morphological transformations and convolutions, where the main difference is that the defect map image tells the algorithm which pixels are going to be replaced, and performs the calculations with the surviving pixels. For small star resizing tasks, this may work fine. A suitable "defect map" may be created from the gradient of the image.

- Deconvolutions: If properly used, stars will be reduced and their peaks increased. With a good mask, you can use it to affect only the outer regions of the stars.

- Curves: Decrease the L curve... using a mask, or course.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: Better star reduction
« Reply #3 on: 2010 September 25 15:34:40 »
I have been using MT to reduce star size and find that stars seem to get both smaller and a little misshapen like little + signs. To deal with this I follow MT with Atrous Wavelets to blur the stars slightly. On Atrous try: "x" the first layer and set second layer to -0.1. Using iterations of MT also helps setting the amount to say 0.5 and doing the process twice. Atrous can be used after each iteration of MT or just after the last iteration. Use trial and error, of course. ;D

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
Re: Better star reduction
« Reply #4 on: 2010 September 25 17:36:46 »
What we need is a module that forms a new PSF at the centroid location.

Max

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Better star reduction
« Reply #5 on: 2010 September 26 04:31:23 »
Quote
What we need is a module that forms a new PSF at the centroid location

I assume that you mean it 'creates a mask, based on a PSF, at an established centroid'. I don't think we would be wanting to 'paint on artificially created stars' :o
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline DaveS

  • PixInsight Addict
  • ***
  • Posts: 115
    • Dave's Astronomy Pages
Re: Better star reduction
« Reply #6 on: 2010 September 26 15:08:16 »
I have been using MT to reduce star size and find that stars seem to get both smaller and a little misshapen like little + signs.

This is the effect I immediately noticed when I used MT on a 'star mask' the very first time I used it. As I don't see this effect when using 'expand' and 'feather', followed by the application of the 'minimum' filter in Photoshop, it seemed alien to me, and hence my discussing this with Harry.

I should add, that if you apply the minimum filter in PS more than once, then the stars will take on a diamond shape. There is a way around this, which is to rotate the image through 90 degrees, before applying the filter for a second time.

That said, there is enough control over the parameters of the PS minimum filter, to make only a single application ample. The brightness of the stars can always be lifted if desired.

Creating a star layer is much easier in Pixinsight, but star reduction is easier and more effective in Photoshop.

I hope that my comments will be viewed in the constructive manner that they are intended.

I am trying PI as a prospective new customer, and as such will speak openly and honestly of my findings during the trial period.

Dave
« Last Edit: 2010 September 26 15:14:51 by DaveS »
8" LX200ACF
William Optics FLT110
NEQ6 Mount
SXVF-H9
SXVR-16
SX Lodestar
DMK21AU04
Baader LRGB and NB filters
DiY Observatory
http://www.progressiveastroimaging.com/davesastronomy/

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Better star reduction
« Reply #7 on: 2010 September 26 15:11:56 »
Quote
I hope that my comments will be viewed in the constructive manner that they are intended.

Of course! That's the spirit here ;)

Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Better star reduction
« Reply #8 on: 2010 September 26 15:13:03 »
Quote
will speak openly and honestly

Bummer! We're all devious and dishonest here!

 >:D
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline DaveS

  • PixInsight Addict
  • ***
  • Posts: 115
    • Dave's Astronomy Pages
Re: Better star reduction
« Reply #9 on: 2010 September 26 15:17:17 »
Bummer! We're all devious and dishonest here!

 :laugh: :laugh: :laugh:

Dave
8" LX200ACF
William Optics FLT110
NEQ6 Mount
SXVF-H9
SXVR-16
SX Lodestar
DMK21AU04
Baader LRGB and NB filters
DiY Observatory
http://www.progressiveastroimaging.com/davesastronomy/

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • PegasusAstronomy.com & Starshadows.com
Re: Better star reduction
« Reply #10 on: 2010 September 26 15:33:29 »
Try this on your masked stars
1.   MT
2.   Blur wit Atrous Wavelets
3.   Use L curves to enhance luminosity
4.   Add some Color Saturation
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Better star reduction
« Reply #11 on: 2010 September 26 16:05:01 »
Today I played a bit with the star size reduction again... The gradient of the image worked as a very good mask. Both a combinations of the MT and a very mild sharpen improved a lot the star profiles.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Better star reduction
« Reply #12 on: 2010 September 26 16:57:55 »
Part of my MWAIC presentation I didn't get to show was something like this:

- star mask
- MT with star mask applied
- remove star mask
- gentle HT to brighten things back up

I then show that the stars look similar to before but the target (M101 in this case) was more pronounced. In effect you've brightened the target without blowing out the stars. This is similar to what Jack is talking about.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Better star reduction
« Reply #13 on: 2010 September 26 18:37:15 »
Yes, but you are changing everything :) It is better to apply a sharpen procedure to recover the central peaks ;) USM with sigma around 1.2 usually works fine.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Better star reduction
« Reply #14 on: 2010 September 28 12:05:21 »
Hi

Thanks for the ideas , but as this is a very common problem to deal with I do think we need a more straight forward approach to this as even though I do not have a problem with a mask , I then want to use a module / script that reduces stars in size without me taking a degree  :yell:

Sounds like a challenge for someone please


Harry
Harry Page