Author Topic: Question: Deconvoultion warning "local divergence"  (Read 4024 times)

Offline andyschlei

  • PixInsight Addict
  • ***
  • Posts: 157
    • View Profile
    • http://www.obsballona.org
Question: Deconvoultion warning "local divergence"
« on: 2008 March 11 21:44:12 »
I am processing a lunar mosaic.  When running deconvolution on the image, I get the warning message

Code: [Select]
Iteration 77/100: 100%
*** Warning: local divergence at iteration #77. Accumulated divergence: 0.253597
   sigma=0.00997724 delta=-0.00014327 noise=0.00069897 significant=0.15275]


I completed another mosaic a few weeks ago and had this problem then but it went away when I cropped the image inside the blocks of the mosaic.  This time, that is not practical.  The image would lose too much if it were cropped.

This time, I made the background 100% black, hoping to avoid the problem, but there it is.  Would white be better?

In addition there is an effect of the edges of the mosaic, probably from processing the black pixels there.

What does this warning mean?  Does it matter?  What next steps would you recommend?  I'll post raw data if that will help.

Thanks in advance,

--Andy

P.S., Congratulations to Vincent Peris on the APOD of the Sombrero Galaxy!
[/code]
Observatorio de la Ballona
CDK 12.5, NP-101, C-11
AP-1200, AP-900
ST-10 XME, CFW-8, Astrodon v2 filters
Pyxis Rotator, TCF Focuser

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6716
    • View Profile
    • http://pixinsight.com/
Re: Question: Deconvoultion warning "local divergence"
« Reply #1 on: 2008 March 12 02:44:51 »
Hi Andy,

This warning tells you that you're going too far with deconvolution :)

The regularized deconvolution algorithms that we have implemented in the Deconvolution tool are globally convergent. This means that after a sufficiently large number of iterations, the algorithms converge to a stable solution. Once this point has been reached, performing more iterations does not improve the deconvolved result.

If you perform more deconvolution iterations beyond convergence, the algorithms usually become locally divergent. When this happens, the signal/noise ratio starts getting worse and better successively, and the neat result is that no further improvement can be achieved.

Code: [Select]
Iteration 77/100: 100%
*** Warning: local divergence at iteration #77. Accumulated divergence: 0.253597
   sigma=0.00997724 delta=-0.00014327 noise=0.00069897 significant=0.15275]


In this example, you probably should stop at about 70 or 75 iterations. 100 iterations won't hurt your image, but you'll be basically wasting time to no avail.

The information given is as follows:

sigma
The standard deviation of the image after the last deconvolution iteration. This value should decrease between successive iterations. If it increases, then the procedure is locally divergent.

delta
The ratio of improvement in standard deviation between the previous and current iterations. This value is equal to:

delta = (sigma_prev - sigma)/sigma

and should always be positive. If it is negative, then the procedure is locally divergent.

noise
The estimated standard deviation of the noise (either assuming a Gaussian or a Poisson noise model, depending on your choice in regularization parameters). This value should decrease between successive iterations.

significant
This measures the amount of significant structures in the image. Significant structures are what we are trying to improve with regularized deconvolution. This number should decrease between successive iterations.

Quote
I completed another mosaic a few weeks ago and had this problem then but it went away when I cropped the image inside the blocks of the mosaic.  This time, that is not practical.  The image would lose too much if it were cropped.


Nice mosaic. Did you use Dynamic Range Extension (high range) to prevent saturation? I definitely prefer the first version (more contrasted).

Quote
This time, I made the background 100% black, hoping to avoid the problem, but there it is. Would white be better?


An important problem with mosaics are steep transitions at block edges, which cause strong ringing problems. Ringing can fool the regularization algorithms, which may prevent you from applying deconvolution correctly. A white background can be even worse, since then dark rings will occur over the image. You have two possible solutions:

- Blur all mosaic block edges reasonably, and use a black background. This will prevent steep transitions that cause ringing.

- Use a neutral gray background, as similar as possible to the mean gray level of the image. You can also blur edges in this case.

Quote
I'll post raw data if that will help


I can take a look if you want. My schedule is quite full, though, so I'll be slow. The mosaic problem is interesting, and I'm thinking in a script to automatically blur block edges.

Quote
P.S., Congratulations to Vincent Peris on the APOD of the Sombrero Galaxy!


He's out of town now but sure will be happy to read this. Congratulations again Vicent!

Cheers,
Juan
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline andyschlei

  • PixInsight Addict
  • ***
  • Posts: 157
    • View Profile
    • http://www.obsballona.org
Re: Question: Deconvoultion warning "local divergence"
« Reply #2 on: 2008 March 12 20:04:34 »
Quote from: "Juan Conejero"
Hi Andy,

This warning tells you that you're going too far with deconvolution :)


Well, that's what I figured.  That's what warnings are for, after all.


Quote from: "Juan Conejero"

In this example, you probably should stop at about 70 or 75 iterations. 100 iterations won't hurt your image, but you'll be basically wasting time to no avail.


Given that the warning first showed up on iteration 8, I probably should have stopped even sooner.  :)

Quote from: "Juan Conejero"
Nice mosaic. Did you use Dynamic Range Extension (high range) to prevent saturation? I definitely prefer the first version (more contrasted).


Thanks!  Yes, I used dynamic range extension to prevent saturation, although I think I will be more aggressive with that feature in the future.  One problem I had with evaluating its use in preview is that it lowers overall brightness, so it is hard to separate that from the sharpening as one evaluates the newer version of the image.  I am now just checking the bright areas to make sure that I don't clip on the high end.

Quote from: "Juan Conejero"
An important problem with mosaics are steep transitions at block edges, which cause strong ringing problems. Ringing can fool the regularization algorithms, which may prevent you from applying deconvolution correctly. A white background can be even worse, since then dark rings will occur over the image.


With my first mosaic, the warnings went away when I cropped the image.  I assumed that the algorithm could not deal with the sharp gradient at the edge.  The warnings went away when I cropped out the missing areas.


Quote from: "Juan Conejero"
You have two possible solutions:

- Blur all mosaic block edges reasonably, and use a black background. This will prevent steep transitions that cause ringing.

- Use a neutral gray background, as similar as possible to the mean gray level of the image. You can also blur edges in this case.


It was late last night so I did not try to hard to match the background in Photoshop (that is how I made the mosaic.  Is there a way to align partially matched images in PixInsight?).  I just tried black instead of empty the last time.

Quote from: "Juan Conejero"
I can take a look if you want. My schedule is quite full, though, so I'll be slow. The mosaic problem is interesting, and I'm thinking in a script to automatically blur block edges.


I'll post again when I have it up on anonymous ftp.  Let me work on it before I ask for your valuable time. :)

Thanks for the help.

--Andy
Observatorio de la Ballona
CDK 12.5, NP-101, C-11
AP-1200, AP-900
ST-10 XME, CFW-8, Astrodon v2 filters
Pyxis Rotator, TCF Focuser