I think what is happening is that the 9x9 or 11x11 Airy disk is too small to simulate a real Airy disk. It is allowing spatial frequencies above the diffraction cutoff to leak past. Then David's inverse filter is able to restore most of those higher-than-cutoff frequency details as well as the lower frequencies (on which it does a superior job).
To be more realistic I think it will be necessary to go with a bigger simulated Airy disk.
Wow, you are absolutely right. It makes a HUGE difference in this case; 9x9 was far too small to nullify the higher-than-cutoff frequencies in the same way the full Airy disk does. I tried a 127x127 kernel and indeed, my algorithm now cannot recover those frequencies at all. Also I notice that global contrast is quite visibly reduced using the 127x127 kernel, which didn't happen with the 9x9 for obvious reasons.
I used the Airy disk formula from
Wikipedia, using the libc implementation of the Bessel function, double _j1(double). My result differed slightly from Bart's in the inner 9x9 pixels. Any idea why? Bart, was your kernel actually an Airy disk convolved with an OLPF?
I attempted to save the 127x127 kernel in the same format as Bart posted his 9x9 (except for using a PNG instead of a TIFF for the picture version):
Airy127x127_6.4micron_564nm_f32.zip (data file)Airy127x127_6.4micron_564nm_f32.png (16-bit PNG)Here's the original, convoluted and deconvoluted fourier transforms (logarithm of the absolute value of each color channel) — click one to see full DFT as a max-quality JPEG:
The residual frequencies outside the ellipse are due to the use of a 127x127 kernel instead of one as big as the picture.
Convoluted 16-bit/channel PNG:
0343_Crop+Diffraction127x127.png (5.1 MB)Deconvoluted max-quality JPEG:
0343_Crop+Diffraction127x127+DFT_division.jpg (1.1 MB)So as you can see, my algorithm doesn't do so well with a real Airy disk. It has significant ringing. Do the other algorithms/programs demonstrated earlier in the thread deal with this 127x127-convoluted 16-bit PNG just as well as they dealt with the 9x9-convoluted one?
BTW, Bart, do you have protanomalous or protanopic vision? I notice you always change your links to blue instead of the default red, and I've been doing the same thing because the red is hard for me to tell at a glance from black, against a pale background.
Cheers,
David