Author Topic: New script for denoising linear monochannel images  (Read 89185 times)

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: New script for denoising linear monochannel images
« Reply #90 on: 2016 January 07 09:47:29 »
Hi Joel,

1) You can crop before denoising. The flatfield must be cropped likewise. With DynamicCrop, set the crop bounds on the image, but before committing, drag the process icon to the flatfield, then commit on the image. Both should be cropped the same way.

2) Select and copy all of the lines in the Process Console window generated by ImageIntegration, use the Script Editor window to paste the lines into a new .txt file, save, and then load in the script. The denoiser will set Variance scale to account for the average frame normalization and weighting.

Thanks,
Mike

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: New script for denoising linear monochannel images
« Reply #91 on: 2016 January 07 09:55:37 »
Got it, thanks Mike.  Is there any reason, as far as MureDenoise is concerned, that I SHOULD crop before running the script?  Will black borders from registration negatively affect the denoising? 
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: New script for denoising linear monochannel images
« Reply #92 on: 2016 January 07 10:01:30 »
Hi Joel, this is something I have not tested. Guessing I think the script will work fine with black borders. Maybe you could try and let me know if you see anything bad? I will also test by adding a synthetic black border on my data.

Thanks,
Mike

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: New script for denoising linear monochannel images
« Reply #93 on: 2016 January 07 10:23:55 »
Hi Joel,

A quick test with synthetic black borders on one of my images: The script works fine with black borders.

I added a black border around my image, and a matching border on the flatfield, not black but rather a fill color of 0.5, as a zero in a flatfield would not be valid.

The denoised results look great. I generated the method noise image and see no artifacts in the image, along the border edges or elsewhere. In the black border areas there is a extremely small random looking texture in the range of 0.0 to ~0.01 DN visible only with an extreme stretch. This is of course negligible.

So the only restriction is no black borders in the flatfield. Denoising with black borders and no flatfield works fine likewise.

Thanks,
Mike
« Last Edit: 2016 January 07 10:29:29 by mschuster »

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: New script for denoising linear monochannel images
« Reply #94 on: 2016 January 07 10:32:49 »
Just to be clear, I understood you to say previously that one should use a flat if denoising a stacked image, correct?

I just can't believe what kind of results I'm getting with this script.  It's so easy and appears to work really well, as well as correctly handling signal vs. noise. 
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: New script for denoising linear monochannel images
« Reply #95 on: 2016 January 07 10:41:25 »
Thank you Joel,

Using a flatfield is optional. A flat can be used either on a single frame or on a stacked image. Either way specifying a flat helps the script account for differing noise levels due to vignetting. This is more useful on telescopes with lots of vignetting. When vignetting is small the improvement is negligible.

Regards,
Mike

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: New script for denoising linear monochannel images
« Reply #96 on: 2016 January 07 18:45:40 »
OK Mike, I've got a new one for you.  I'm currently working on an image of M42.  The main Red stack has 12-15min subs.  Of course I needed to take shorter exposures for the core, so I also took 12-1min and 12-30sec exposures for an HDRCombination.  In the .zip file I've linked to below there are 3 files:

"Orion_R" is the original stack with 12-15min images
"Orion_R_HDR" is the HDRCombination stack including 12-15min, 12-1min and 12-30sec images. 
And a master FLAT

When I used MureDenoise on the "Orion_R" image I get a very pleasing result.  Here were the parameters I used:
Gain = 0.335
Gaussian Noise = 16.02
Offset = 0
Variance Scale = 1.0
Cycle Spin Count = 16
I also used a flat.

Now here's the problem: when I use these same parameters on the "Orion_R_HDR" image it turns out horribly.  I first tried lowering the Variance Scale all the way down to 0.1 but it was still ugly.  Realizing that the HDR image now contained 36 images rather than 12, I changed the Combination Count to 36 and with a Variance of 0.1 the result was a lot better but I still saw some artifacts. 

How does using HDRCombination mess up the denoising process?  It seems to me like the only parts of the short exposure images that would be added to the main image would be the core of M42 and would not really affect the overall noise of the main image, yet it really messed up MureDenoise.

Here's a link to a zip file containing the images:
https://www.dropbox.com/s/mely703edrtkzgs/Orion.zip?dl=0

Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: New script for denoising linear monochannel images
« Reply #97 on: 2016 January 07 19:19:29 »
Hi Joel,

Sorry for the trouble. The script will not denoise HDR combinations properly. In general the script does not work properly on linearly or nonlinearly processed images. Processing alters noise statistics in ways the script cannot handle.

Regards,
Mike
« Last Edit: 2016 January 07 21:02:40 by mschuster »

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: New script for denoising linear monochannel images
« Reply #98 on: 2016 January 07 19:24:02 »
I knew that, but I guess I didn't think that the HDRCombination script really "processed" the image at all...guess I was wrong. 
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline pengsloth

  • Newcomer
  • Posts: 15
Re: New script for denoising linear monochannel images
« Reply #99 on: 2016 January 07 22:36:52 »
I used the script on a HDR image. However what I did was run the script on the long exposure image only and then combined the denoised long image with the normal short exposure. Because the short exposure is generally much better signal to noise it turned out great. Though I guess if your short image was also noisy you could denoise it too before combining.

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: New script for denoising linear monochannel images
« Reply #100 on: 2016 January 08 05:47:18 »
Yeah, that's what I did too.  Worked fine.
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline jerryyyyy

  • PixInsight Old Hand
  • ****
  • Posts: 425
    • Astrobin Images
Re: New script for denoising linear monochannel images
« Reply #101 on: 2016 January 18 10:24:23 »
Hi,

Have been working away with the script and generally very happy but thought, Hey if this is good on a regular L image, what about a Super_L, where the RGB are added in.  I have some 28 L subs and an additional 16 each of RGB. 

I am still getting noise reduction, but it looks "pasty" unless I set the G noise very low....  When I run the ImageIntegration Proc and compare for example the G noise they are 2.09 versus 0.94 (to the -4) for the L versus Super L. 

Does this make any sense (sanity check please). 

Keep up the good work!

BTW, I have drizzle files on these data if you have any suggestions, guess that will not help. 
« Last Edit: 2016 January 18 11:42:16 by jerryyyyy »
Takahashi 180ED
Astrophysics Mach1
SBIG STT-8300M and Nikon D800
PixInsight Maxim DL 6 CCDComander TheSkyX FocusMax

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: New script for denoising linear monochannel images
« Reply #102 on: 2016 January 19 14:00:10 »
Hi Jerry,

Sorry for the trouble, MureDenoise will not denoise multifilter combinations properly.

Thanks,
Mike
« Last Edit: 2016 January 19 21:32:39 by mschuster »

Offline joelshort

  • PixInsight Addict
  • ***
  • Posts: 260
    • Buckeyestargazer.net
Re: New script for denoising linear monochannel images
« Reply #103 on: 2016 February 16 11:42:48 »
Mike,
The more I use MureDenoise the more I really like it.  Fantastic!  The one suggestion I might make is that when I load the variance scale from a txt file created from the ImageIntegration process there is a pop up window that states the variance scale and the number of images used.  The variance scale automatically gets changed in the main window, but the combination count does not.  If you're forgetful like me, I might forget to change the combination count or worse yet can't remember how many images are in the stack.  Auto-populating that field would save me from myself.
Joel Short
www.buckeyestargazer.net
CFF135 f6.7, SV80ST, G3-16200M, QHY163M, QHY183M

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
Re: New script for denoising linear monochannel images
« Reply #104 on: 2016 February 17 15:28:51 »
Mike,
The more I use MureDenoise the more I really like it.  Fantastic!  The one suggestion I might make is that when I load the variance scale from a txt file created from the ImageIntegration process there is a pop up window that states the variance scale and the number of images used.  The variance scale automatically gets changed in the main window, but the combination count does not.  If you're forgetful like me, I might forget to change the combination count or worse yet can't remember how many images are in the stack.  Auto-populating that field would save me from myself.

Can't we get the variance and number images put in the image header with XSIF after integration?
The script could automatically populate this info. Juan should jump at the chance for another use of XSIF ;)

Also, can some post a screen shot on how to make the integration txt file?

And Mike this is a kill app!