Click or drag to resize

FftGrid Class

The FftGrid is used as an intermediate step in FFT processing. It transforms a grayscale image into the FFT domain, and is required prior to all FFT filters.
Inheritance Hierarchy
SystemObject
  Atalasoft.Imaging.ImageProcessing.FftFftGrid

Namespace:  Atalasoft.Imaging.ImageProcessing.Fft
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public class FftGrid : IDisposable

The FftGrid type exposes the following members.

Constructors
  NameDescription
Public methodFftGrid
Initializes a new instance of the FftGrid class.
Public methodFftGrid(AtalaImage)
Initializes a new instance of the FftGrid class
Top
Properties
  NameDescription
Public propertyHeight
Gets the height of this FftGrid.
Public propertyImage
Gets or sets the AtalaImage associated with this FftGrid.
Public propertyWidth
Gets the width of this FftGrid.
Top
Methods
  NameDescription
Public methodDispose
Cleans up unmanaged resources.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Finalizes an instance of the FftGrid class.
(Overrides ObjectFinalize.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodStatic memberGetNextPowerOfTwo
A helper function that retrieves the next power of two (128, 256, 512, 1024, etc). x^2
Public methodGetProcessedImage
Returns the processed image from the frequency domain.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
When using the Grid as the intermediate step, multiple FFT filters can be applied. Each FFT Command has an ApplyToGrid method that uses an FftGrid to process. Once the image has completed processing, be sure to return the changed image with the GetProcessedImage method.
Examples
FftGrid Example (C#)
// Load an 8-bit grayscale image.
AtalaImage image = new AtalaImage(@"D:\Test Images\JPG\8-bit alpha mask.jpg");

// Resize the image so its width and height are a power of 2.
Size newSize = new Size(FftGrid.GetNextPowerOfTwo(image.Width), FftGrid.GetNextPowerOfTwo(image.Height));
ResampleCommand resample = new ResampleCommand(newSize);
AtalaImage temp = resample.ApplyToImage(image);
image.Dispose();

// Create an FftGrid from the image and apply a filter to it.
FftGrid grid = new FftGrid(temp);
ButterworthHighPassFftCommand cmd = new ButterworthHighPassFftCommand(1.2, 2.4);
cmd.ApplyToGrid(grid);

// Get the resulting image.
this.viewer.Image = grid.GetProcessedImage();
temp.Dispose();
FftGrid Example (Visual Basic)
' Load an 8-bit grayscale image.
Dim image As AtalaImage =  New AtalaImage("D:\Test Images\JPG\8-bit alpha mask.jpg") 

' Resize the image so its width and height are a power of 2.
Dim NewSize As Size =  New Size(FftGrid.GetNextPowerOfTwo(image.Width),FftGrid.GetNextPowerOfTwo(image.Height)) 
Dim resample As ResampleCommand =  New ResampleCommand(NewSize) 
Dim temp As AtalaImage =  resample.ApplyToImage(image) 
image.Dispose()

' Create an FftGrid from the image and apply a filter to it.
Dim grid As FftGrid =  New FftGrid(temp) 
Dim cmd As ButterworthHighPassFftCommand =  New ButterworthHighPassFftCommand(1.2,2.4) 
cmd.ApplyToGrid(grid)

' Get the resulting image.
Me.viewer.Image = grid.GetProcessedImage()
temp.Dispose()
See Also