Author Topic: Creating Mask of Target only  (Read 11887 times)

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Creating Mask of Target only
« on: 2013 October 29 02:34:33 »
PixInsight World,

The Star Mask tool and Clones are great if you want a mask that either (i) allows you to work on or protect just the stars in an image or (ii) create a luminance mask to work on or protect the bright regions of an image.  But I have not found a general tool that allows you to subtract the stars from a Clone/Luminance Mask so that you can work on the target of the image but not on the stars or the background.

Is there a way to subtract a star mask from a luminance mask using pixelmath or some other method of achieving the same result?

I'm sure there are several working solutions but I haven't found them  :-[.

Thanks,

Jim

Jim

Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Creating Mask of Target only
« Reply #1 on: 2013 October 29 03:21:00 »
Jim,

I have been playing with this recently.  Possibly not the optimal way to do it but it has worked for me:
  • Create a luminance mask, stretching if necessary and clipping the blacks a bit
  • Create a nice star mask, usually taking the target image and running an aggressive HDRMT on it first
  • Apply this PixelMath expression to the luminance mask: iif(star_mask>0.2,min($T,0.8-star_mask),$T)
  • Blur the resulting mask a bit by removing layers 1..4 with ATWT

Hope that helps.

Cheers,
Rick.

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Creating Mask of Target only
« Reply #2 on: 2013 October 29 03:58:44 »
Rick,

Thanks loads!  I was trying to do that myself but I am hopeless when it comes to deciphering pixelmath without a striped cane to help (not to suggest you in any way resemble a striped cane, just saying).

Will try this out.

Best,

Jim 
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Creating Mask of Target only
« Reply #3 on: 2013 October 29 04:04:22 »
Rick,

Quick question, in the formula, it starts with "iif".  Should that be "if"?

Thanks,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Creating Mask of Target only
« Reply #4 on: 2013 October 29 04:51:22 »
Rick,

Quick question, in the formula, it starts with "iif".  Should that be "if"?

Thanks,

Jim

Jim, it is definitely "iif"  :)

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Creating Mask of Target only
« Reply #5 on: 2013 October 29 05:02:16 »
See, this is why I am worthless in pixelmath  :smiley:
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline sreilly

  • PixInsight Padawan
  • ****
  • Posts: 791
    • Imaging at Dogwood Ridge Observatory
Re: Creating Mask of Target only
« Reply #6 on: 2013 October 29 07:02:48 »
When your mask is created it seems you have a choice. Use as is or invert it which allows you to work on the part not covered by the stars. Make your mask as usual, apply the mask and then try your process on a clone such as HDRW and then try it with the mask inverted. The invert mask icon is displayed when you have it checked under View|Tool Bars|Mask. I usually invert the mask and choose Show Mask which actually hides it at this point. My quick examples don't show a very good mask but for this purpose it works well.

Hope this makes some sense.

Steve
www.astral-imaging.com
AP1200
OGS 12.5" RC
Tak FSQ-106ED
ST10XME/CFW8/AO8
STL-11000M/FW8/AO-L
Pyxis 3" Rotator
Baader LRGBHa Filters
PixInsight/MaxIm/ACP/Registar/Mira AP/PS CS5

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Creating Mask of Target only
« Reply #7 on: 2013 October 29 07:04:37 »
Hi Jim!
I produced a Video which should help to achieve what you want.
http://dl.dropbox.com/u/57910417/Howto_enhance_nebuala_without_pushing_stars.wmv

There is also some usage of PixelMath in there, but you can copy the Parameter
and use them without any change, so PixelMath understanding is not necessary.

Gerald

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Creating Mask of Target only
« Reply #8 on: 2013 October 29 07:21:13 »
Gerald,

Great, thanks!  I will try it out tonight.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Creating Mask of Target only
« Reply #9 on: 2013 November 07 07:58:18 »
Gerald,

I was finally able to clear my calendar and take a look at the video you so kindly posted for me to try out. 

You are amazing!!  Your tutorial was fantastic and you are a true master of PI!  If I can develop a 10th of your skill I will consider myself a huge success.

Most importantly, you suggest in the tutorial that you have done others as well and I am particularly interested in your tutorials in PixelMath that you mentioned.  Do you have a link to your tutorials that you can share?

Truly inspiring.

All the best,

Jim

PPS:  Given your accent, I assume you are from Germany or Austria.  Two of my favorite countries. If you don't mind saying, where exactly are you from.  I have a number of friends in Hamburg and Vienna.
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Creating Mask of Target only
« Reply #10 on: 2013 November 07 09:35:52 »
Hi Jim!
Hope the Video Tutorial was helpful.
The other tutorials can be selected from my Homepage:
http://www.werbeagentur.org/oldwexi/tipstest.html

Yes, you are right the accent is austrian, i am living 30 km South of Vienna.

Gerald

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Creating Mask of Target only
« Reply #11 on: 2013 November 07 22:31:22 »
Gerald,

Your tutorial list is like a giant PI toybox to explore!  I am especially excited about your set of tutorials on PixelMath.

Thanks so much for sharing.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline djrlx90

  • Newcomer
  • Posts: 10
Re: Creating Mask of Target only
« Reply #12 on: 2013 November 22 06:05:58 »
I just watched your Ring Mask Tutorial and I was blown away.  That is exactly what I was trying to figure out how to do.  I noticed that the regular star mask when used with MT, killed the cores of the stars.  I wanted to just reduce the size with out reducing intensity.  I knew I had to get a mask of the rings, but had no idea how to do it.  Thanks so much!!!!

Offline Jameedon

  • Newcomer
  • Posts: 34
    • AstroBin
Re: Creating Mask of Target only
« Reply #13 on: 2013 November 24 22:51:42 »
Gerald,

I'm using your video tutorial to try to build the mask we're going for but nothing works for me how it does for you in the video.  For instance, when I used MultiscaleMedianTransform on the image that had a star mask, there weren't any stars that were removed, even after I did it twice.  Then in your next step you have us use the Morphological Transformation which made the photo look horrible.  Check it out.

https://www.dropbox.com/s/w9s4p14bambcm4y/attemptofstarremovel.jpg

I was using your parameters which could be the problem and I should mess around with my own settings according to the image I'm working on.  Plus something else that could be an issue is the amount of stars, there are alot.
-Jamee


Some of my equipment:

Mounts: CEM60 + CGEM   Scopes: 8" EdgeHD + ES 102ED + C80   Cameras: Atik 314L+/EFW2 FW + SX Lodestar X2 + ASI120MC + Canon 650D full spec

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Creating Mask of Target only
« Reply #14 on: 2013 November 25 01:57:12 »
Hi Jameedon!
Please put the fits file where you started to produce the starmask on the dropbox.
I will have a look at it.

Yes, you are right the parameter will vary from Image to Image, the workflow
was the idea to show in the video.

Gerald