LBitmap::FrqFilter

#include "ltwrappr.h"

static L_INT LBitmap::FrqFilter(pFTArray, prcRange, uFlags)

pFTARRAY pFTArray;

/* pointer to structure */

LPRECT prcRange;

/* pointer to range rectangle */

L_UINT uFlags;

/* flags */

Filters the frequency harmonics data produced by a Fourier Transform function using a range rectangle. This function is available in the Raster Pro and above toolkits.

Parameter

Description

pFTArray

Pointer to an FTARRAY structure. The acxData member of the FTARRAY structure is a two-dimensional array holding the frequency components.

prcRange

Specifies 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.

uFlags

Flags that indicate the operation to be performed on the specified X and Y harmonics ranges. You can use a bit wise OR (|) to specify one flag from each group.

 

The following flags represent operations on the X harmonics range:

 

Value

Meaning

 

FRQ_INSIDE_X

[0x0001] Keep the X harmonics inside X range and remove outside ones.

 

FRQ_OUTSIDE_X

[0x0002] Remove the X harmonics inside X range and keep outside ones.

 

The following flags represent operations on the Y harmonics range:

 

Value

Meaning

 

FRQ_INSIDE_Y

[0x0010] Keep the Y harmonics inside Y range and remove outside ones.

 

FRQ_OUTSIDE_Y

[0x0020] Remove the Y harmonics inside Y range and keep outside ones.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function is used only when working with Fourier Transform functions.

Before using this function, call the LBitmap::AllocFTArray function to allocate a FTARRAY structure large enough to hold the Fourier Transform coefficients for pBitmap. When the array is no longer needed, free the allocated array by calling the LBitmap::FreeFTArray function.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

This function does not support 12 and 16-bit grayscale and 48 and 64-bit color images. If the image is 12 and 16-bit grayscale and 48 and 64-bit color, the function will not return an error.

Required DLLs and Libraries

LTIMGCOR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddShadow LBitmap::AllocFTArray, LBitmap::ChangeHueSatInt, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter, LBitmap::DirectionEdgeStatistical2

Topics:

Raster Image Functions: Fourier Transform Functions

 

Removing Noise

 

Raster Image Functions: Removing Noise

Example

L_INT LBitmap__FrqFilterExample(LBitmap *pLeadBitmap, pFTARRAY pFTArray) 
{
   /* this example  filters the acxData of a pFTARRAY structure produced by the Fast Fourier Transform function*/
   RECT    rcRange; 
   rcRange.left  = 0; 
   rcRange.right = pLeadBitmap->GetWidth () / 4; 
   rcRange.top = 0; 
   rcRange.bottom = pLeadBitmap->GetHeight () / 2; 
   /*lpFTData is  known*/
   /* filters the frequencies*/
   return LBitmap::FrqFilter(pFTArray, &rcRange, FRQ_INSIDE_X | FRQ_INSIDE_Y); 
}