Using StarNet++ with StarTools on linear data

Guides, tutorials, tips & tricks.
User avatar
admin
Site Admin
Posts: 3382
Joined: Thu Dec 02, 2010 10:51 pm
Location: Melbourne
Contact:

Using StarNet++ with StarTools on linear data

Post by admin »

Hi all,

Some people have been playing with StarNet++, which attempts to use a NeuralNet to remove stars from an image. There are currently a good few limitations, one of them being that it only works on post-processed images. The following steps allow you to StarNet's output in StarTools on linear(!), unprocessed data.

Here is how (it's probably longer than needed, but I'm trying to be thorough and catch cases where the Starless image has been normalized as well);

1. Load the (stretched) StarNet input (e.g. with stars still in place) image in StarTools. Don't turn Tracking on.
2. Launch the Layer module.
3. Load the (stretched) StarNet output (e.g. with stars removed) image in the Layer module.
4. Set Layer Mode to "Difference". You could skip to step 9 here, but the following steps may be needed if the Starless image has been normalized.
5. Click Copy.
6. Click Paste Foreground.
7. Set Layer Mode to "Multiply Foreground Only".
8. Set Blend Amount to 500%.
9. Keep the result.
10. Launch the Develop module.
11. Set Skyglow to 49%.
12. Keep the result.
13. Save the image.
14. Now load your linear image into StarTools. Don't turn Tracking on just yet.
15. Launch the Heal module.
16. In the Mask editor, load the image you just saved as a mask. StarTools will automatically convert it into a mask and all stars should be correctly selected at this point.
17. Back in the Heal module, your stars will be healed out using the mask.
18. Keep the result.
19. Turn Tracking on & process as normal.

Hope this helps anyone!
Ivo Jager
StarTools creator and astronomy enthusiast
almcl
Posts: 265
Joined: Wed Jan 21, 2015 7:15 pm
Location: Shropshire. UK

Re: Using StarNet++ with StarTools on linear data

Post by almcl »

Thanks for this, Ivo.

Had a play with Starnet and it certainly 'removes the stars' but ran into a problem with the work flow at step 3 above. StarTools will not load the Starnet output file:
Untitled-1.jpg
Untitled-1.jpg (20.44 KiB) Viewed 27991 times
At first I thought this might be .tiff vs .tif confusion (the Starnet .bat file uses the .tif extension for some reason) but not so. I got round it by converting the .tif file to a .FTS file and this loaded correctly, but it made me wonder if there's something wrong with my system as ST often refuses to load a .tiff that has been created in other software?

Any thoughts would be welcome?
Skywatcher 190MN, ASI 2600 or astro modded Canon 700d, guided by OAG, ASI120, PHD2
User avatar
admin
Site Admin
Posts: 3382
Joined: Thu Dec 02, 2010 10:51 pm
Location: Melbourne
Contact:

Re: Using StarNet++ with StarTools on linear data

Post by admin »

Hi,

StarTools only imports uncompressed IBM PC byte-order TIFFs, which most applications should be able to produce.
There are many types of compression, some even proprietary. Adding all these without significantly bloating the application (and running into licensing issues as well) is something I'm keen to avoid.

A simple solution would be to add a conversion step (for example using ImageMagick) to the batch file or script;

Code: Select all

convert input.tif -depth 16 +compress output16bituncompressed.tiff
Ivo Jager
StarTools creator and astronomy enthusiast
almcl
Posts: 265
Joined: Wed Jan 21, 2015 7:15 pm
Location: Shropshire. UK

Re: Using StarNet++ with StarTools on linear data

Post by almcl »

Thanks for that, Ivo, I'll give it a shot.
Skywatcher 190MN, ASI 2600 or astro modded Canon 700d, guided by OAG, ASI120, PHD2
dariv
Posts: 51
Joined: Thu Sep 28, 2017 11:39 am

Re: Using StarNet++ with StarTools on linear data

Post by dariv »

Ivo,
In step 1, load stretched data, What is the source of this image? I'm thinking specifically as it applies to S-H-O data.
The rest of the steps I think I follow, just not sure where the initial stretched data input for StarNEt comes from.
Thanks,
-DaRiv
User avatar
admin
Site Admin
Posts: 3382
Joined: Thu Dec 02, 2010 10:51 pm
Location: Melbourne
Contact:

Re: Using StarNet++ with StarTools on linear data

Post by admin »

dariv wrote:Ivo,
In step 1, load stretched data, What is the source of this image? I'm thinking specifically as it applies to S-H-O data.
The rest of the steps I think I follow, just not sure where the initial stretched data input for StarNEt comes from.
Thanks,
-DaRiv
The source image in this case, is the "processed" image you would normally feed to StarNet++. E.g. this source image has been stretched to bring out all the stars so that StarNet++'s neural net can "see" them. StarNet++ only works with "finished" images. However, with the guide above, we can use StarNet++'s smarts to successfully process a linear dataset in StarTools. The crux of the method, is the creation of a perfect star mask, by having StarTools look at which pixels were modified by StarNet++.

Once that star mask has been extracted, StarTools' heal module should actually yield superior results in terms of removal, as the Heal module is agnostic when it comes to the replacement of stars. StarNet++'s neural net will be only as good as the stars it has been trained on when it comes to replacing them.

Does that help?
Ivo Jager
StarTools creator and astronomy enthusiast
dariv
Posts: 51
Joined: Thu Sep 28, 2017 11:39 am

Re: Using StarNet++ with StarTools on linear data

Post by dariv »

I’d like to use this to process stars separately from a nebula for example and see how that goes. Assuming I have three channels to combine, how is this accomplished?
For example, how much processing should be done to the starnet input file? Combine and autodev or something more?
The process you outlined leads to a clean starless image. At what point in the process can you extract the stars to be processed separately and when do you layer them back in?
Thanks!
User avatar
admin
Site Admin
Posts: 3382
Joined: Thu Dec 02, 2010 10:51 pm
Location: Melbourne
Contact:

Re: Using StarNet++ with StarTools on linear data

Post by admin »

dariv wrote:I’d like to use this to process stars separately from a nebula for example and see how that goes. Assuming I have three channels to combine, how is this accomplished?
For example, how much processing should be done to the starnet input file? Combine and autodev or something more?
The process you outlined leads to a clean starless image. At what point in the process can you extract the stars to be processed separately and when do you layer them back in?
Thanks!
The point of using the procedure is to obtain a star mask, using StarNet++'s star detection. All I/we know is that StarNet++ only works on (e.g. has been trained with) stretched, processed images. Other than that, it's a bit of a black box. What you do with the mask once obtained (and when) is up to you (separating, healing, recombining, etc). I suppose for best results from StarNet++ (and thus most accurate mask), you would process the three combined channels to "perfection" and pass this to StarNet++, in the hope that StarNet++ will detect all stars. After you have obtained the star mask, you can process however you like.

To be quite honest, I am not terribly convinced about processing stars and background separately. I have never seen a good reason for this, as it essentially assumes that some processes work better with interpolated data instead of having the stars in place. The thing is, that is exactly what star masks are for on a case-by-case basis.

All that said, for those people who want to experiment with StarNet++'s capabilities, except using those capabilities on linear data (e.g. data that StarNet++ was never trained on), now you can! :)
Ivo Jager
StarTools creator and astronomy enthusiast
dariv
Posts: 51
Joined: Thu Sep 28, 2017 11:39 am

Re: Using StarNet++ with StarTools on linear data

Post by dariv »

I'm specifically referring to data captured with narrowband filters. There is a little more freedom there to experiment with false color combinations than RGB, IMHO.
For example, straight "Hubble" processing techniques generally produce purple halos. Some people would say that is correct for that type of image, others are put off by the purple. I've seen images where the stars were removed in an SHO image and RGB stars were layered in. And again, some will see this as not being a true representation of the object while others are more interested in the "art" of the image.
these are some reasons I can see wanting to process the stars separately for a different overall effect.

If I understand you correctly, you're saying to fully process an image as you normally would. Than feed that image into starnet. Than use that same image and the output from stanet to create a starmask. At this point, start over with the linear data, in my case combine the 3 channels, then go to the heal module using the starmask to remove the stars from the combined channels. After that then you can turn on tracking and follow the normal workflow; autodev, wipe, decon, ect...
This should give a similar image to the one originally fed into starnet, minus the stars.

Now I suppose you could use that star mask to go back to the step where we used the heal module and this time keep just the stars? Process that image and then layer that with the new starless image?
User avatar
admin
Site Admin
Posts: 3382
Joined: Thu Dec 02, 2010 10:51 pm
Location: Melbourne
Contact:

Re: Using StarNet++ with StarTools on linear data

Post by admin »

dariv wrote:I'm specifically referring to data captured with narrowband filters. There is a little more freedom there to experiment with false color combinations than RGB, IMHO.
For example, straight "Hubble" processing techniques generally produce purple halos. Some people would say that is correct for that type of image, others are put off by the purple. I've seen images where the stars were removed in an SHO image and RGB stars were layered in. And again, some will see this as not being a true representation of the object while others are more interested in the "art" of the image.
these are some reasons I can see wanting to process the stars separately for a different overall effect.
These are absolutely good use cases, but they don't really require complete removal of the stars (given they are being replaced and/or their colour is just being altered). Again, in such use case you'd be after the mask, but not so much the StarNet++ output in its own right.
If I understand you correctly, you're saying to fully process an image as you normally would. Than feed that image into starnet. Than use that same image and the output from stanet to create a starmask. At this point, start over with the linear data, in my case combine the 3 channels, then go to the heal module using the starmask to remove the stars from the combined channels. After that then you can turn on tracking and follow the normal workflow; autodev, wipe, decon, ect...
This should give a similar image to the one originally fed into starnet, minus the stars.
Correct! :thumbsup:
Now I suppose you could use that star mask to go back to the step where we used the heal module and this time keep just the stars? Process that image and then layer that with the new starless image?
Indeed! Once you have the mask isolated, you have total freedom to do all sorts of fancy stuff :)
Ivo Jager
StarTools creator and astronomy enthusiast
Post Reply