ImageForge module DFT contains algorithms for Discrete Fourier Transform. It allows transformation of the image to the frequency domain, spectral filtration, convolution, deconvolution and inverse transformation. Module can handle only square images, i.e. images with equal height and width expressable as powers of two. Otherwise image has to be transformed into smaller or greater by filling new pixels with zeros, with original image data, or with mirrored image to fit these conditions.

Original image | Magnitude |

It is possible to work with the image in frequency domain by use of implemented filters, e.g. circular symmetric lowpass / highpass Butterworth filter.

Magnitude after application of highpass filter | Image after application of highpass filter |

Magnitude after application of lowpass filter | Image after application of lowpass filter |

The user can also define custom filter by filtration mask with square, scissor or circle shape. All coefficients inside selected mask are multiplied by certain constant or replaced by zeros.

Original damaged image | Mask selection |

Magnitude after applying mask | Reconstructed image |

Convolution theorem allows us to perform complex space convolution as multiplication of spectra in frequency domain. At first the convolution mask is transfomed into frequency domain. According to the convolution theorem the image spectrum and convolution mask must have the same number of coefficients in both coordinates. The module contains functions multiplying spectra which corrensponds to the convolution. By the deconvolution you may choose one from two possible solutions - deconvolution by classic inverse filtration or by Wiener filter.

Original damaged image | Image after reconstruction by deconvolution |

Finally you have to apply inverse Fourier transform. You simply choose the way how to perform the operation: normal mode, equal phase for all coefficients or equal amplitude for all coefficients.

DFT - setting up the parameters | Selection of filter and its parameters |