LBitmap::FrqFilterMask

#include "ltwrappr.h"

virtual L_INT LBitmap::FrqFilterMask(pFTArray, bOnOff)

pFTARRAY pFTArray;

/* pointer to structure */

L_BOOL bOnOff;

/* flag */

Creates a mask filter to remove specific frequency components from a bitmap. This function is available in the Raster Pro and above toolkits.

Parameter

Description

pFTArray

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

bOnOff

Value that indicates whether the frequency components are removed if the corresponding pixel value is zero. Possible values are:

 

Value

Meaning

 

TRUE

If the pixel value equals zero the frequency components in its location in acxData will be removed, otherwise no change. A component is "removed" when both members of the corresponding L_COMPLEX structure are set to 0.

 

FALSE

The frequency component in the pixel location in acxData will be multiplied by the value of the pixel divided by 255.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function is used only when you are dealing with Fourier Transform functions.

The Mask bitmap will be treated as grayscale bitmap. The (0,0) frequency located in mask bitmap center; positive X harmonics located in the right half of the mask bitmap and positive Y harmonics located in the lower half of the mask bitmap. Mask bitmap’s dimensions must be equal to acxData’s dimensions.

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

This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.

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

LTIMG

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::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter

Topics:

Raster Image Functions: Fourier Transform Functions

 

Removing Noise

 

Raster Image Functions: Removing Noise

Example

void TestFunction(LBitmap *pLeadBitmap, LBitmap *pMaskBitmap, pFTARRAY pFTArray) 
{
   /* Assume acxData field of pFTArray is the correct size*/
   /* apply DFT*/
   pLeadBitmap->DFT (pFTArray, NULL, DFT_DFT | DFT_GRAY); 

   /* filter frequencies */
   pMaskBitmap->FrqFilterMask( pFTArray, TRUE); 

   /* apply inverse DFT */
   /* After this call, the image should be clean */
   pLeadBitmap->DFT (pFTArray, NULL, DFT_IDFT | DFT_ALL|      DFT_IDFT_SCL); 

}