Description It is an enhanced highpass filter function which preserves low frequency components. It uses Fast Fourier Transform (FFT) algorithm to obtain the Fourier spectrum. In the frequency domain, a filter function attenuates the low frequency components. After that, the inverse FFT algorithm is applied to go back to the spatial domain. Then part of the original image is added back to the highpass result, which restores partially the low-frequency components lost in the highpass filtering operation. It works with 4, 8 or 24 bits/pixel.. In case of 4 or 8 bits/pixel, the source DIB must contain grayscale image and the palette values in the source DIB must be monotone increasing. It makes no sense to use this function in case of 1 bits/pixel. If the source DIB size is not a power of two, zero padding is used.
Examples
Syntax lRet = [BIFilter.]FreqDIBEnhance Dib Cutoff Attenuate bFFTMethod bShowDialog
Remarks lRet LONGLONG Handle of the newly created DIB on success or 0 on failure.
Dib LONGLONG Source DIB.
Cutoff Long Cutoff frequency.
Attenuate double Controls the low-frequency component.
bFFTMethod BOOL Fast Fourier Transform method
bShowDialog BOOL Show dialog box
Cutoff frequency
This function does not pass any frequency components if the ‘nCutoff’ parameter is greater than the radius of the image. For example if the size of the source image is 128 x 128, then the zero pass frequency is sqrt(2) * 128 / 2 = 90. Of course this is true only if fAttenuate = 1.
fAttenuate
If fAttenuate = 1, then no part of the original image is added back, so this function is the same as the FreqDIBHighpass() function. If fAttenuate > 1, then part of the original image is added back to preserve low frequency components. Recommended value is 1.1.
bFFTMethod
If bFFTMethod = TRUE, then the Fourier transformed of the image will be processed by Sin and Cos functions, if bFFTMethod = FALSE, then it will be processed by square root functions.
bShowDialog
This parameter specifies that is the dialog box to be showed or not.
See Also