gen_bandpass ( : ImageBandpass : MinFrequency, MaxFrequency, Size : )

Generate an ideal bandpass filter.

gen_bandpass generates an ideal bandpass filter in the frequency domain. The DC term is assumed to lie in the center of the image. The parameters MinFrequency and MaxFrequency determine the cutoff frequencies of the filter (in pixels). The resulting image contains an annulus with the value 255, and the value 0 outside of this annulus.


Parameters

ImageBandpass (output_object)
image -> object : byte
Bandpass filter in the frequency domain.

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

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

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


Example
my_lowpass(Hobject Image, Hobject *Result)
{
  Hobject  FFT, Bandpass, FFTConvol;
  fft(Image,&FFT);
  gen_bandpass(&Bandpass,20,40,512);
  convol_fft(FFT,Bandpass,&FFTConvol); 
  clear_obj(Bandpass); clear_obj(FFT);
  fft_image_inv(FFTConvol,Result);
  clear_obj(FFTConvol);
}

Result

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


Parallelization Information

gen_bandpass is reentrant and processed without parallelization.


Possible Successors

convol_fft


Alternatives

gen_circle, paint_region


See also

gen_highpass, gen_lowpass, gen_bandfilter


Module

Image filters



Copyright © 1996-2005 MVTec Software GmbH