Author Topic: Deconv deringing wrecks images ?  (Read 37579 times)

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: Deconv deringing wrecks images ?
« Reply #45 on: 2011 March 04 18:50:14 »
Is there a way to save a preview to test and compare each result ...

Click on the preview tab (where it's ID is), drag it "out". Now you have a new image just as the preview looked like when you dragged it "out"....

Testing on a preview has advantages: not only you don't have to un-do to revert back to the original state, but it doesn't involve swapping AFAIK, so it's also faster. It also "inherits" whatever mask you had applied over to the original image if that was the case...

Quote
or am I better off just creating a cropped image and using that to do fast tests?

Cropping really is a tool that's better to use it when you really need to do some cropping IMHO...


Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Deconv deringing wrecks images ?
« Reply #46 on: 2011 March 05 05:12:20 »
Hi Neil,

Welcome to PixInsight Forum.

Quote
1) For the Gaussian PSF, where are the settings determined?  Is it just guessing, or where/how is the PSF created?

We still don't have an officially released PSF measurement tool (although this will change soon). As has been noted in other posts though, guessing a very good PSF is usually quite easy by some trial-error work. With a little practice it's a matter of a few minutes.

Always start by looking at some of the smallest stars in your linear image (you need the STF tool to do this). As a star is a point source, it provides a good sample of the PSF. For example, for your image, a standard deviation of 1.2 pixels seems quite appropriate (more on how I know this later).

Quote
2) Ditto for shape and aspect ratio?

For deep-sky images, always use pure Gaussian PSFs (shape=2). Other shapes are useful to simulate close-to-diffraction-pattern PSFs, which can be used with high-resolution lunar and planetary images. Unless you have elongated stars that you want to fix with deconvolution, leave aspect ratio with its default value of one (perfectly round stars).

Quote
3) After doing the decon on the linear data, I did a histogram stretch and saved the before and after as a 16-bit TIF so I could take into ImageReady to do the animated GIF.  The images looked posterized, as though they were 8-bit images.  I checked in Photoshop, and they had the same appearance.  What did I do wrong?

Nothing wrong from what you've described. A 16-bit TIFF image is pretty standard and should be readable without problems in other applications. As I don't have the applications you have mentioned I can't say for sure, but it seems a problem related to poor screen rendering. I have downloaded the 16-bit images from the links you've posted and they show perfectly in free software applications such as Gwenview and Gimp.

I think you can deconvolve your image further. I have made a small test that you can see in the attached screenshots.

Since you have posted a nonlinear (stretched) image, I can't test deconvolution directly on it. However, I have applied a histogram transformation to linearize the image. The HT has a midtones balance value of 0.98. Of course, this is just an approximate guess but it allows me to show you how to deconvolve images like this one.

The other screenshot shows the Deconvolution instance that I have applied. In general, always use the regularized Richardson-Lucy algorithm with deep-sky images. Regularized Van Cittert works better for lunar and planetary images, but RRL is more controllable for deep-sky.

Note that I haven't used a deringing support image (no local deringing) since this is a quick try. In the real world local deringing is necessary to prevent rings around the brightest stars --only for these; the rest of ringing problems are fixed by the global deringing algorithm.

When the PSF is very small (as in this case where sigma=1.15px), better results can usually be achieved by upsampling the image prior to deconvolution. For example, you can upsample x2 with the Resample tool. With an upsampled image the PSF is also proportionally larger, and this allows us to sample it much more accurately.

Hope this helps.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Deconv deringing wrecks images ?
« Reply #47 on: 2011 March 05 08:20:14 »
What is the difference between selecting a star mask as our local deringing image, and actually applying the mask directly to the image we're about to deconvolve?
I noticed they don't produce the same results.

Besides the fact that local deringing acts at each deconvolution iteration, a deringing support has nothing to do with a mask. The support image is used to drive a special deringing algorithm, while a mask works by balancing two images to generate a third resulting image. This local deringing algorithm basically works by limiting growth of negative image structures as a result of the Gibbs phenomenon.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Deconv deringing wrecks images ?
« Reply #48 on: 2011 March 05 08:23:10 »
Now I'm confused. Apply the mask or only list it in the local support or both?

Both are independent each other, and both can be used at the same time to different purposes. You can select a deringing support image (which usually is a star mask) to prevent ringing around bright stars, and at the same time you can use a mask (which usually is a luminance mask) to protect low SNR regions.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • PegasusAstronomy.com & Starshadows.com
Re: Deconv deringing wrecks images ?
« Reply #49 on: 2011 March 05 08:29:54 »
OK, say one is going to deconvolve a Lum image.  What is the best source for the supporting image for the local deranging.  Or how do you create that image to be used for the local deranging.
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Deconv deringing wrecks images ?
« Reply #50 on: 2011 March 05 08:53:32 »
Quote
What is the best source for the supporting image for the local deranging.  Or how do you create that image to be used for the local deranging.

For deep-sky images, deringing support images are always star masks. The reason is easy: stars are the objects that cause most ringing artifacts, so we want to protect them.

For deringing purposes, you only want the brightest stars included in your star mask; dim stars are perfectly protected by the global deringing algorithm. So in general building these star masks is very easy.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline sreilly

  • PixInsight Padawan
  • ****
  • Posts: 791
    • Imaging at Dogwood Ridge Observatory
Re: Deconv deringing wrecks images ?
« Reply #51 on: 2011 March 05 09:19:28 »

When the PSF is very small (as in this case where sigma=1.15px), better results can usually be achieved by up sampling the image prior to deconvolution. For example, you can up sample x2 with the Resample tool. With an up sampled image the PSF is also proportionally larger, and this allows us to sample it much more accurately.



Juan,

I used another program, MaxIm, to determine the PSF of my image and got a result of between 1.4 and 1.5. What range is considered small and what does up sampling the image for deconvolution give us? After deconvolution, do you down sample back to the original size? If up sampling the image do we up sample the mask as well?  I'll be putting some tests of these images using 50, 100, and 200 iterations of RLR both with the mask applied to the image and with it only listed under deringing local support for comparisons. I am concerned about the changes to the background that I've seen so far but now that this is different than I was doing before it may have a different outcome.

Thanks,
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 RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: Deconv deringing wrecks images ?
« Reply #52 on: 2011 March 05 09:27:03 »
I am concerned about the changes to the background that I've seen so far but now that this is different than I was doing before it may have a different outcome.

IMHO background and other areas low in SNR (like Juan mentioned) should always be protected when doing a deconvolution.
Adjusted luminance-based masks work pretty well for that (some people binarize them, I usually don't, but do some histogram adjustment).

Offline sreilly

  • PixInsight Padawan
  • ****
  • Posts: 791
    • Imaging at Dogwood Ridge Observatory
Re: Deconv deringing wrecks images ?
« Reply #53 on: 2011 March 05 09:39:01 »
I am concerned about the changes to the background that I've seen so far but now that this is different than I was doing before it may have a different outcome.

IMHO background and other areas low in SNR (like Juan mentioned) should always be protected when doing a deconvolution.
Adjusted luminance-based masks work pretty well for that (some people binarize them, I usually don't, but do some histogram adjustment).


So does  this mean the possibility of using two masks for the deconvolution process? One for the local deringing support and the other, possibly hst adjusted, for the background being applied to the image at time of deconvolution? It hadn't occurred to me to create the mask and then make hst adjustment to increase the effectiveness of that mask. Sort of like a procedure used in PS for reducing color noise via a mask! I like that thought. Seems if I remember correctly that mask was inverted. I'll have to think this through a bit more. Is there a way to invert an image in PI? I can honestly say that masks aren't my strong suit, if I even have one. :D
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 RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: Deconv deringing wrecks images ?
« Reply #54 on: 2011 March 05 09:55:25 »
So does  this mean the possibility of using two masks for the deconvolution process?

Absolutely. You can even build the external mask by mix-and-match combining two different masks if you like.

Quote
Sort of like a procedure used in PS for reducing color noise via a mask!

Actually, luminance based masks are commonly used in PixInsight as well... even more so than in PS, since most people using PS rely on lasso/color range/magic wand to do their selections.

Quote
Is there a way to invert an image in PI?

Ctrl-I in Windows. Or Menu Image -> Invert...

Quote
I can honestly say that masks aren't my strong suit, if I even have one. :D

Get used to them  ;) Masks are at the heart of getting the most out of many processing tools. And IMHO PixInsight has the best tools to build masks for astroimage processing I've ever seen. Sometimes it may not be very intuitive, but powerful, it is. That, excluding the ability to manually paint the masks, something for which everyone has their own opinion.



Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: Deconv deringing wrecks images ?
« Reply #55 on: 2011 March 05 10:12:41 »
Master Juan,

Quote
Always start by looking at some of the smallest stars in your linear image (you need the STF tool to do this). As a star is a point source, it provides a good sample of the PSF. For example, for your image, a standard deviation of 1.2 pixels seems quite appropriate (more on how I know this later).

I'm still trying to understand how to estimate the PSF. Could you please explain how you do this. Is the method/formula you discussed in the NCG 5189 processing tutorial a reasonable approach?  In the example you determined the PSF by dividing the FWHM from the image in pixels by 2.35482. The latter number is derived from the formula for the FWHM of a Gaussian function.

This thread continues to provide great information. Thanks Juan, RBA, Steve .....

Steve



Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline sreilly

  • PixInsight Padawan
  • ****
  • Posts: 791
    • Imaging at Dogwood Ridge Observatory
Re: Deconv deringing wrecks images ?
« Reply #56 on: 2011 March 05 10:17:05 »
I had a senior moment on the inverting question. I've been doing that in PI for a while using the invert mask icon. What was I thinking. I just tried that in deconvolution using the standard mask I made for the local deringing support and then applying that same mask and inverting it. I still need to do this experiment using the same cropped image area and do 50, 100, and 200 iterations now using three different approaches to compare. The first will be a basic with only the local deringing mask listed. The second with the mask listed and applied to the image. The third with the mask listed, applied and then inverted.  
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 sreilly

  • PixInsight Padawan
  • ****
  • Posts: 791
    • Imaging at Dogwood Ridge Observatory
Re: Deconv deringing wrecks images ?
« Reply #57 on: 2011 March 05 16:23:50 »
As I promised, I have two pages with comparisons of the different ways I tried deconvolution on the same image. This is a cropped area of NGC3628 that is about 1/4 of the full frame. It is 16 - 20 minute luminance images combined in PI using average combine with Linear Fit clipping. The image was saved as a 32 bit floating point fit. That image was cropped to get clean boarders as I dither my images. That image was again cropped leaving the lower right 1/4 of the image. Image scale is .49 arc seconds per pixel. The first page, http://www.astral-imaging.com/Deconvolution%20Comparisons.htm, has the images with the information below. I hope this format works well but if not, let me know and I'll try something else. The second page is basically the same layout and images except they have had HDRWavelets applied. That can be found here http://www.astral-imaging.com/Deconvolution%20Comparisons%20with%20HDRW.htm

Suggestions, corrections or any other sage advice is appreciated.

Thanks,
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 robhawleyastro

  • Newcomer
  • Posts: 34
Re: Deconv deringing wrecks images ?
« Reply #58 on: 2011 June 05 09:01:43 »
Thanks from me also

I am working with grayscale images so RGB problems are not an issue. 

What I noticed from your example is that you greatly reduced the StdDev.  That reduced the number of pixels affected by the deconvolution.  A 7x7 grid is more like the size of PSF that I have used with other tools.  Now Deconvolution is working.