Herror ::gen_bandfilter (
    Hobject *ImageFilter,
    const HTuple &MinFrequency,
    const HTuple &MaxFrequency,
    const HTuple &Size
)
HImage HImage::GenBandfilter (
    const HTuple &MinFrequency,
    const HTuple &MaxFrequency,
    const HTuple &Size
)

Generate an ideal band filter.

::gen_bandfilter generates an ideal band 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 0, and the value 255 outside of this annulus.


Parameters

ImageFilter (output_object)
image -> Hobject * : HImage ( byte )
Band filter in the frequency domain.

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

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

Size (input_control)
integer -> HTuple.long
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(Image,&FFT);
  gen_bandfilter(&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_bandfilter returns H_MSG_TRUE if all parameters are correct. If necessary, an exception handling is raised.


Possible Successors

::convol_fft


Alternatives

::gen_circle, ::paint_region


See also

::gen_highpass, ::gen_lowpass, ::gen_bandpass


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH