PANDORE Version 6 GREYC-IMAGE

pgaussianfilter



Designs lowpass, highpass, bandpass or bandreject Gaussian filter.



Synopsis

pgaussianfilter [-m mask] ncol nrow ndep highpass cutin cutoff [im_out|-]

Description

pgaussianfilter designs either a lowpass, highpass, bandpass or bandreject Gaussian filter. If ndep<2 the filter im_out is a 2D float image with size nrow*ncol otherwise the filter im_out is a 3D float image with size ndep*nrow*ncol.

The Gaussian lowpass filter cuts off high-frequency components of the Fourier transform that are at a distance greater than a specified distance D0 (the cutoff value) from the origin of the centered transform.

The transfer function for a 2D Gaussian lowpass filter and with cutoff frequency at distance D0 from the origin is defined as:

   Hlp(u,v) = exp(-D2(u,v)/2D02)

where D(u,v) is the distance of point (u,v) from the origin:

   D(u,v)=sqrt((u-M/2)2 + (v-N/2)2)

where N the number of rows and M the number of columns.

The transfert function for a Gaussian highpass is defined as:

   H(u,v) =  1- Hlp(u,v)

The transfer function for a band reject is:

   H(u,v) = Hhp(u,v) - Hlp(u,v)

where Hhp(u,v) is the highpass filter with cutoff parameter and Hlp(u,v) is the lowpass filter with cutin parameter.

Parameters

Outputs

Result

Returns SUCCESS or FAILURE in case of bad parameter values.

Examples

Performs Gaussian lowpass filtering:

   psetcst 0 tangram.pan i1.pan
   pfft tangram.pan i1.pan i2.pan i3.pan
   pgaussianfilter 256 256 0 0 0 100 i4.pan
   pmult i2.pan i4.pan i5.pan
   pmult i3.pan i4.pan i6.pan
   pifft i5.pan i6.pan out.pan i8.pan

Performs Gaussian highpass filtering:

   psetcst 0 tangram.pan i1.pan
   pfft tangram.pan i1.pan i2.pan i3.pan
   pgaussianfilter 256 256 0 1 0 50 i4.pan
   pmult i2.pan i4.pan i5.pan
   pmult i3.pan i4.pan i6.pan
   pifft i5.pan i6.pan out.pan i8.pan
Performs Gaussian bandreject filtering:

   psetcst 0 tangram.pan i1.pan
   pfft tangram.pan i1.pan i2.pan i3.pan
   pgaussianfilter 256 256 0 0 25 50 i4.pan
   pmult i2.pan i4.pan i5.pan
   pmult i3.pan i4.pan i6.pan
   pifft i5.pan i6.pan out.pan i8.pan

Performs Gaussian bandpass filtering:

   psetcst 0 tangram.pan i1.pan
   pfft tangram.pan i1.pan i2.pan i3.pan
   pgaussianfilter 256 256 0 1 25 50 i4.pan
   pmult i2.pan i4.pan i5.pan
   pmult i3.pan i4.pan i6.pan
   pifft i5.pan i6.pan out.pan i8.pan

See also

Frequency, pifft, pfftshift

C++ prototype

Errc GaussianFilter( Img2dsf &im_out, int ndep, int nrow, int ncol, int highpass, float cutin, float cutoff );

Version française

Génère un filtre Gaussien passe-bas, passe-haut, coupe-bande ou passe-bande.


Author: Régis Clouard