Hi Terry,

Terry Duell wrote:
> On Sat, 02 Apr 2011 23:19:23 +1100, kfj <[email protected]> wrote:
> 
> >
> >
> >your test image is 10x10. This is an unusual choice for a matrix to be
> >subjected to an FFT, and the underlying algorithm may well pad it with
> >zeroes up to the next power of two (16x16). Maybe feed a 16x16 in?

While modern FFT algorithms mostly can handle non-power-of-two dimensions that
still might be a good idea, and I'd even increase the size further - read below.

> >Your test image has sharp discontinuities which seem to jump from zero
> >to maximum. This may be asking too much. Did you try to recover the
> >original image doing an IFFT after the FFT to make sure the double
> >transform keeps all information?

This will always work, even for the weirdest images.  But those sharp jumps
cause extremely high power in the high frequencies of your fourier image, and
when dividing this by the MTF (Modulation Transfer Function - the FFT of the
PSF) you create false signals that ruin your reconstructed image.

> I have just tried my basic experiment using a 16x16 test image, and
> can recover the original image exactly after the FFT, so that's all
> OK.

One assumption of FFT is that the image repeats in both spatial directions.
For your example (homogenuous background) this is by chance almost the case.
For real-world images, one has to apply an so-called apodisation that 'dimms'
the image down to a constant value.  One typically uses a cos-squared drop-off
over a few pixels for that.  So you use something like

 (image-average(image)) x ApoWindow  + average(image)

This window function can either be a continuous cos^2 over the whole size, or
just over a few pixels (so that the value in the most part is 1).  

Because of this it might be a good idea to use somewhat larger image sizes,
e.g., 24 or 32, so you can apply a border-only window function.

> Applying the psf to the blurred still doesn't give back a result
> even close to the sharp, so there are probably other things not
> right with what I am doing. A bit more homework to do.

I think you solved this (other mail)?  In any case it might be an idea to look
at the PSF (i.e., in spatial space, not in FFT) and clean it or fit it with a
model.  

> 
> >If I'm not mistaken, deconvolving is an iterative process (i.e. you
> >have to do it repeatedly), and recovery of the source image is never
> >complete. Don't expect miracles. There's only so much you can do with
> >bad data.
> 
> You are probably right. I had somehow gained the impression that
> deconvolution is only an iterative process in the time domain.

Depends a bit.  Iterations (like Lucy-Richardson) are normally done because of
noise issues, which are non-linear.  There are other methods used in image
reconstruction that do a one-step deconvolution, but that also needs a good
estimate of the noise power to create a weight function (optimum filter),
which is probably not possible in this case :-(

Cheers,

  Pit

-- 
You received this message because you are subscribed to the Google Groups 
"Hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx

Reply via email to