Core Optical, Inc.
IsotropicFrequencyFilter GetFilterImage Method Industrial Strength, Scientific Grade
Gets a OnlineBitmapSource representation of the frequency filter.

Namespace: PrecisionImage.FrequencyDomainProcessing
Assembly: PrecisionImage (in PrecisionImage.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax

public BitmapSource GetFilterImage(
	int dimension,
	GrayBitDepth outputBitDepth,
	GammaEncoding gammaEncoding
)

Parameters

dimension
Type: OnlineSystem Int32
An OnlineInt32 type specifying the size (height, width) of the returned image. Value must be an integer power of 2.
outputBitDepth
Type: PrecisionImage GrayBitDepth
A GrayBitDepth enum indicating the bit depth of the returned image.
gammaEncoding
Type: PrecisionImage GammaEncoding
A GammaEncoding enum indicating the type of gamma encoding to apply to the generated image. Used only for types Gray8 and Gray16.

Return Value

A OnlineBitmapSource grayscale representation of the frequency filter coefficients (1.0 = white, 0.0 = black).
Exceptions

Remarks

Use this method to visualize the two-dimensional frequency filter. The dimension parameter must be an integer power of 2 or an exception will result. By specifying sRGB, a gamma-encoded gray scale bitmap will be returned. This increases the visiblity of the filter roll-off at low values. If the array of filter coefficients is required, specify GrayBitDepth.ThirtyTwoBit. This will return a OnlineBitmapSource object containing the filter coefficients themselves. In this case the gammaEncoding parameter is ignored.

The generated OnlineBitmapSource is always a square image. This mirrors the manner in which the spectrum is processed.

Examples

The following instantiates a narrow isotropic band-pass filter (lower frequency edge = 0.45f, upper frequency edge = 0.55f, low frequency order = 8, upper frequency order = 10) and displays it in an image control as a linearly scaled 8-bit grayscale image.
using PrecisionImage.FrequencyDomainProcessing;

// Instantiate the filter object with the parameters of interest: 
IsotropicBandPassFilter filter = new IsotropicBandPassFilter(0.45f, 0.55f, 8, 10);

// Display the filter as a 1024 x 1024 grayscale image:
image.Source = filter.GetFilterImage(1024, GrayBitDepth.EightBit, GammaEncoding.None);

The above example generates a figure similar to the following:

See Also