gen_lowpass ( : ImageLowpass : Frequency, Size : )

Generate an ideal lowpass filter.

gen_lowpass generates an ideal lowpass filter in the frequency domain. The DC term is assumed to lie in the center of the image. The parameter Frequency determines the cutoff frequency of the filter (in pixels). The resulting image contains a circle of radius Frequency with the value 255, and the value 0 outside of this circle.


Parameters

ImageLowpass (output_object)
image -> object : byte
Highpass filter in the frequency domain.

Frequency (input_control)
real -> real
Cutoff frequency.
Default value: 20
Suggested values: 10, 20, 30, 40, 50, 60, 70, 100
Typical range of values: 1 <= Frequency <= 200
Minimum increment: 1
Recommended increment: 1

Size (input_control)
integer -> integer
Size (dimension) of the image (filter).
Default value: 512
List of values: 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192


Example
my_lowpass(Hobject Image, Hobject *Result, int frequency, int size)
{
  Hobject  FFT, Lowpass, FFTConvol;
  fft(Image,&FFT);
  gen_lowpass(&Lowpass,frequency,size);
  convol_fft(FFT,Lowpass,&FFTConvol); 
  clear_obj(Lowpass); clear_obj(FFT);
  fft_image_inv(FFTConvol,Result);
  clear_obj(FFTConvol);
}

Result

gen_lowpass returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception handling is raised.


Parallelization Information

gen_lowpass is reentrant and processed without parallelization.


Possible Successors

convol_fft


Alternatives

gen_circle, paint_region


See also

gen_highpass, gen_bandpass, gen_bandfilter


Module

Image filters



Copyright © 1996-2005 MVTec Software GmbH