﻿ Rectangle Property (FrequencyFilterCommand) | Leadtools.ImageProcessing.Core | Raster, Medical, Document Help
←Select platform
In This Topic ▼

# Rectangle Property

Summary
Gets or sets a rectangle structure that contains the filter dimension that will be applied.
Syntax
C#
C++/CLI
Python
``public LeadRect Rectangle { get; set; } ``
````public: `
`property LeadRect Rectangle { `
`   LeadRect get(); `
`   void set (    LeadRect ); `
`} ````
``Rectangle # get and set (FrequencyFilterCommand) ``

#### Property Value

Rectangle structure that contains the filter dimension that will be applied, it represents the frequency range to be kept or removed. The left value refers to the minimum X harmonic, the right refers to the maximum X harmonic, the top refers to the minimum Y harmonic and the bottom refers to the maximum Y harmonic. The maximum X harmonic equals Width -1 and the maximum Y harmonic equals Height -1.

Example
C#
````using Leadtools; `
`using Leadtools.Codecs; `
`using Leadtools.ImageProcessing; `
`using Leadtools.ImageProcessing.Core; `
` `
`public void FrequencyFilterConstructorExample() `
`{ `
`   // Load an image `
`   RasterCodecs codecs = new RasterCodecs(); `
`   codecs.ThrowExceptionsOnInvalidImages = true; `
` `
`   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\FourierTransform.jpg")); `
` `
`   // Prepare the command `
`   // Resize the image to make sure the image's dimensions are power of two. `
`   SizeCommand sizeCommand = new SizeCommand(256, 256, RasterSizeFlags.Bicubic); `
`   sizeCommand.Run(image); `
` `
`   FourierTransformInformation ftArray = new FourierTransformInformation(image); `
`   // Apply FFT. `
`   FastFourierTransformCommand command = new FastFourierTransformCommand(ftArray, FastFourierTransformCommandFlags.FastFourierTransform | FastFourierTransformCommandFlags.Gray); `
`   command.Run(image); `
` `
`   LeadRect rcRect = new LeadRect(0, 0, image.Width / 2, image.Height / 2); `
`   FrequencyFilterCommand freqCommand = new FrequencyFilterCommand(); `
`   freqCommand.Flags = FrequencyFilterCommandFlags.InsideX | FrequencyFilterCommandFlags.InsideY; `
`   freqCommand.FourierTransformInformation = ftArray; `
`   freqCommand.Rectangle = rcRect; `
` `
`   FastFourierTransformCommand invCommand = new FastFourierTransformCommand(ftArray, FastFourierTransformCommandFlags.InverseFastFourierTransform | FastFourierTransformCommandFlags.Gray | FastFourierTransformCommandFlags.Scale | `
`         FastFourierTransformCommandFlags.Both); `
`   invCommand.Run(image); `
` `
`} `
` `
`static class LEAD_VARS `
`{ `
`   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; `
`} ````
Requirements