Imagemagick FFT routines
Posted: 2008-05-07T18:03:11-07:00
Friends,
Fred and I have been hard at work on a set of FFT routines for Imagemagick wrapped around FFTW (http://www.fftw.org). We are still ironing out one major incompatibility, but everything else looks to be going well.
Here is what works:
- Magnitude and phase pairs, or optionally real and imaginary pairs can be produced and reassembled correctly.
- Round-trip (IFT(FT(image))) images now have zero difference between the originals when the transform is performed with HDRI.
Here is what does not work:
- We cannot swap an IMFFT mag/phase pair (or real/imag) with one from Photoshop or image/j. Right now, it looks like this is being caused by the transforms employed in converting the FFTW output and what we consider to be an "ideal image." I am going to try to figure this out sometime in the remaining week.
Here is what still needs to be done:
- We need to be able to demonstrate a successful (non trivial) deblurring operation. Fred is working on this right now and I hope to hear from him as soon as I have figured out the transform issue.
- The documentation is woefully out of date. Once the smoke clears on the development, I hope to give some real time to documenting the usage of the functions.
As a reminder, this is still beta code. It is fairly hardy, but has not yet been polished by the core developers. If you would like to get a feel for the routines, I have written a companion program called demo - it is a bit messy, but demonstrates the correct calling sequences for FourierImage(), FourierImages(), InvFourierImage() and InvFourierImages().
To get a magnitude/phase pair of images, use:
./demo f my_input.jpg fft.miff
(Be sure to use miff or one of the other HDRI file types)
This will produce a pair of images fft-0.miff and fft-1.miff corresponding to the magnitude and phase of each image.
The inverse is given with:
./demo i fft-0.miff fft-1.miff my_outfile.tiff
For real and imaginary pairs, substitute "f" and "i" with "g" and "j" respectively.
ftp://depot.aecom.yu.edu/pub/vzXLSQerK7 ... 0/Makefile
ftp://depot.aecom.yu.edu/pub/vzXLSQerK7wd2FMmv230/fft.c
ftp://depot.aecom.yu.edu/pub/vzXLSQerK7wd2FMmv230/fft.h
ftp://depot.aecom.yu.edu/pub/vzXLSQerK7 ... 230/demo.c
You can build everything with the attached Makefile.
Best,
Sean
Fred and I have been hard at work on a set of FFT routines for Imagemagick wrapped around FFTW (http://www.fftw.org). We are still ironing out one major incompatibility, but everything else looks to be going well.
Here is what works:
- Magnitude and phase pairs, or optionally real and imaginary pairs can be produced and reassembled correctly.
- Round-trip (IFT(FT(image))) images now have zero difference between the originals when the transform is performed with HDRI.
Here is what does not work:
- We cannot swap an IMFFT mag/phase pair (or real/imag) with one from Photoshop or image/j. Right now, it looks like this is being caused by the transforms employed in converting the FFTW output and what we consider to be an "ideal image." I am going to try to figure this out sometime in the remaining week.
Here is what still needs to be done:
- We need to be able to demonstrate a successful (non trivial) deblurring operation. Fred is working on this right now and I hope to hear from him as soon as I have figured out the transform issue.
- The documentation is woefully out of date. Once the smoke clears on the development, I hope to give some real time to documenting the usage of the functions.
As a reminder, this is still beta code. It is fairly hardy, but has not yet been polished by the core developers. If you would like to get a feel for the routines, I have written a companion program called demo - it is a bit messy, but demonstrates the correct calling sequences for FourierImage(), FourierImages(), InvFourierImage() and InvFourierImages().
To get a magnitude/phase pair of images, use:
./demo f my_input.jpg fft.miff
(Be sure to use miff or one of the other HDRI file types)
This will produce a pair of images fft-0.miff and fft-1.miff corresponding to the magnitude and phase of each image.
The inverse is given with:
./demo i fft-0.miff fft-1.miff my_outfile.tiff
For real and imaginary pairs, substitute "f" and "i" with "g" and "j" respectively.
ftp://depot.aecom.yu.edu/pub/vzXLSQerK7 ... 0/Makefile
ftp://depot.aecom.yu.edu/pub/vzXLSQerK7wd2FMmv230/fft.c
ftp://depot.aecom.yu.edu/pub/vzXLSQerK7wd2FMmv230/fft.h
ftp://depot.aecom.yu.edu/pub/vzXLSQerK7 ... 230/demo.c
You can build everything with the attached Makefile.
Best,
Sean