FreqDIBWiener

#include "BIFILTER.H"

 

HANDLE CALLBACK FreqDIBWiener( HANDLE      hSrcDIB,
HANDLE      hDFDIB,
double            NSR,
BOOL           bFFTMethod,
int                  SpectMul)

Description

This function will Wiener filter the input DIB by the degradation function DIB in the frequency domain. It works with 4, 8 or 24 bits/pixel images. Inverse filtering of an image is processed by dividing the input image by the degradation function image to obtain the original noiseless image. The noise must be characterizable by a Fourier spectrum (typically linear motion blur). The input is the degraded image and the image of the degradation function. The filter will first process the spectras of both images, after computing a complex division using the transformed images by the following equation:

, where G(u,v) is the degraded spectrum, H(u,v) is the degradation function spectrum, and * means complex conjugation. Finally the filtering returns with the inverse transformed, filtered image. The degradation spectra is multiplied by the SpectMul parameter, so normalization problems can be solved by tuning this parameter. In case of 4 or 8 bits/pixel, the source DIB must contain grayscale images 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 power of two, zero padding is used.

Examples

oszlopontoszblurredoszlopontoszfilteredoszlopontoszrefiltered

 

The 256 x 256 sized blurred image, the Wiener filtered image with a horizontal, linear motion blur degradation function, NSR = 50, and SpectMul = 2000, and the nonlinear maximum and after minimum filtered image of the Wiener filtered image.

Parameters

HANDLE

HSrcDIB

Source DIB

HANDLE

HDFDIB

Degradation Function DIB

double

NSR

The inverse of the Signal-Noise Ratio. If NSR parameter is zero, the wiener filter reduces to the inverse filter. See the description and examples above for further information and a possible value.

BOOL

bFFTMethod

There are two ways realized to process the power spectra of an image. One uses trigonometrical sinus and cosinus functions and the other one uses square root functions. There can be different between the two ways only at the processing time.

Available values:

TRUE (1)                           -     The power spectra will be processed by sinus and cosinus functions.

FALSE (0)                         -     The power spectra will be processed by square root functions.

int

SpectMul

Degradation function multiplying factor.

Return values

Handle of the newly created DIB on success or NULL on failure.

Requirements

Header :     Declared in BIFilter.h; include BIFilter.h.

Library :    Use BIFilter.lib.

DLLs :       BIFilter.dll.