Next: 2.9 Histograms and LUTs Up: 2. VIPS packages Previous: 2.7 Convolution Contents

# 2.8 Frequency filtering

See figure 2.10.

The basic Fourier functions are `im_fwfft()` and `im_invfft()`, which calculate the fast-fourier transform and inverse transform of an image. Also `im_invfftr()`, which just returns the real part of the inverse transform. The Fourier image has its origin at pel (0,0) -- for viewing, use `im_rotquad()` to move the origin to the centre of the image.

Once an image is in the frequency domain, it can be filtered by multiplying it with a mask image. The VIPS mask generator is `im_create_fmask()` see the manual page for details of the arguments, but it will create low pass, high pass, ring pass and band pass filters, which may each be ideal, Gaussian or Butterworth. There is also a fractal mask option.

The other functions in the package build on these base facilities. `im_freqflt()` transforms an input image to Fourier space, multiplies it by a mask image, and transforms it back again. `im_flt_image_freq()` will create a mask image of the correct size for you, and call `im_freqflt()`. `im_disp_ps()` will call the right combinations of functions to make a displayable power spectrum for an image.

Figure 2.10: Fourier functions

Next: 2.9 Histograms and LUTs Up: 2. VIPS packages Previous: 2.7 Convolution Contents