On Sat, 02 Apr 2011 23:19:23 +1100, kfj <[email protected]> wrote:
I have some thoughts on the matter, not sure if they're helpful, but have them anyway. Pardon me for not having read the octave script (I'd have to learn octave first...)
I don't think you would have too much trouble understanding the fundamentals of what is being done.
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?
That's a good point, something I had overlooked...too long since I have worked with this stuff.
Your test image has sharp discontinuities which seem to jump from zero to maximum. This may be asking too much.
That was a deliberate decision, and is a simple way to make a sharp image in greyscale.
Did you try to recover the original image doing an IFFT after the FFT to make sure the double transform keeps all information?
No, haven't tried that.
When I did stuff along these lines, I found it more instructive not to do the convolution in the frequency domain (so, don't do the FFT, just do the convolution). A 10 square or 16 square image is peanuts, you can go quite a bit larger and it'll still take next to no time.
OK. I chose to go the frequency domain route for three reasons. Firstly, I believed it should give exactly the same result as the time domain approach; secondly it is seemed simple to implement in Octave, and finally I had come to the conclusion that a time domain solution required a bespoke and complex program. If you have references that show a simple time domain solution, please let me know.
Rather than trying to reconstruct the PSF that gimp has put on the image by adding motion blur, pick a PSF yourself. You should be able to construct one simply by taking an image all zeroes with a one in the center and applying motion blut to it. Or you might start with something simple like a row of ones between rows of zeroes, for a strictly horizontal motion blur (you may need to do some normalizing).
I tried to reconstruct the psf that gimp applied as that is the approach that I would expect to be applied given that we have the blurred and sharp images. To construct my own psf requires that know exactly what it would do, and that wasn't guaranteed!
To get 'real world' source and target images once you've established the maths, I'd try and align both images (the blurred and the unblurred one) in hugin with as many CPs as possible and optimize well. Do a photometric optimization as well. Crop to your area of interest and have hugin output individual wraped images. These should be as close as they get and you can try and extract the PSF from them.
I went through those processes, and as I said it was not possible to align the two images such that a sensible psf could be found. I came to the conclusion that one needed pixel for pixel alignment (ie exact) to be able to derive a correct psf, and that is where I set off to look at the simple example. Maybe some more experimentation will show that reasonable improvement can be made using a psf derived from mal-aligned images.
Thanks for your comments. I will try again with power-of-two image sizes. Cheers, -- Regards, Terry Duell -- 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
