Creates a mask filter to remove specific frequency components from a bitmap.
#include "ltwrappr.h"
virtual L_INT LBitmap::FrqFilterMask(pFTArray, bOnOff, uFlags = 0)
Pointer to an FTARRAY structure. The acxData field is a two-dimensional array holding the frequency components.
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. |
Reserved for future use. Must be 0.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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 bitmaps dimensions must be equal to acxDatas 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 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.
This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.
Win32, x64.
L_INT LBitmap__FrqFilterMaskExample(LBitmap *pLeadBitmap, LBitmap *pMaskBitmap, pFTARRAY pFTArray)
{
L_INT nRet;
RECT rect;
rect.left=0;
rect.right=1;
rect.bottom=1;
rect.top=0;
/* Assume acxData field of pFTArray is the correct size*/
/* apply DFT*/
nRet =pLeadBitmap->DFT (pFTArray, &rect, DFT_DFT | DFT_GRAY|DFT_RANGE| DFT_INSIDE_X| DFT_OUTSIDE_Y);
if(nRet !=SUCCESS)
return nRet;
/* filter frequencies */
nRet =pMaskBitmap->FrqFilterMask( pFTArray, TRUE);
if(nRet !=SUCCESS)
return nRet;
/* apply inverse DFT */
/* After this call, the image should be clean */
nRet =pLeadBitmap->DFT (pFTArray, NULL, DFT_IDFT | DFT_ALL|DFT_IDFT_SCL| DFT_GREEN|DFT_IDFT_BOTH);
if(nRet !=SUCCESS)
return nRet;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document