ClassesClassesClassesClasses | | | | Operators

wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter (Operator)


wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter — Image restoration by Wiener filtering.


wiener_filter(Image, Psf, FilteredImage : RestoredImage : : )

Herror wiener_filter(const Hobject Image, const Hobject Psf, const Hobject FilteredImage, Hobject* RestoredImage)

Herror T_wiener_filter(const Hobject Image, const Hobject Psf, const Hobject FilteredImage, Hobject* RestoredImage)

Herror wiener_filter(Hobject Image, Hobject Psf, Hobject FilteredImage, Hobject* RestoredImage)

HImage HImage::WienerFilter(const HImage& Psf, const HImage& FilteredImage) const

void WienerFilter(const HObject& Image, const HObject& Psf, const HObject& FilteredImage, HObject* RestoredImage)

HImage HImage::WienerFilter(const HImage& Psf, const HImage& FilteredImage) const

void HOperatorSetX.WienerFilter(
[in] IHUntypedObjectX* Image, [in] IHUntypedObjectX* Psf, [in] IHUntypedObjectX* FilteredImage, [out] IHUntypedObjectX*RestoredImage)

IHImageX* HImageX.WienerFilter(
[in] IHImageX* Psf, [in] IHImageX* FilteredImage)

static void HOperatorSet.WienerFilter(HObject image, HObject psf, HObject filteredImage, out HObject restoredImage)

HImage HImage.WienerFilter(HImage psf, HImage filteredImage)


wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter produces an estimate of the original image (= image without noise and blurring) by minimizing the mean square error between estimated and original image. wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter can be used to restore images corrupted by noise and/or blurring (e.g. motion blur, atmospheric turbulence or out-of-focus blur). Method and realisation of this restoration technique bases on the following model: The corrupted image is interpreted as the output of a (disturbed) linear system. Functionality of a linear system is determined by its specific impuls response. So the convolution of original image and impulse response results in the corrupted image. The specific impulse response describes image acquisition and the occured degradations. In the presence of additive noise an additional noise term must be considered. So the corrupted image can be modeled as the result of

          [convolution(impulse_response,original_image)] + noise_term

The noise term encloses two different terms describing image-dependent and image-independent noise. According to this model, two terms must be known for restoration by Wiener filtering:

  1. degradation-specific impulse response

  2. noise term

So wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter needs a smoothed version of the input image to estimate the power spectral density of noise and original image. One can use one of the smoothing HALCON-filters (e.g. eliminate_min_maxeliminate_min_maxEliminateMinMaxeliminate_min_maxEliminateMinMaxEliminateMinMax) to get this version. wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter needs further the impulse response that describes the specific degradation. This impulse response (represented in spatial domain) must fit into an image of HALCON image type 'real'. There exist two HALCON-operators for generation of an impulse response for motion blur and out-of-focus (see gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion, gen_psf_defocusgen_psf_defocusGenPsfDefocusgen_psf_defocusGenPsfDefocusGenPsfDefocus). The representation of the impulse response presumes the origin in the upper left corner. This results in the following disposition of an NxM sized image:

wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter works as follows:

The result image has got image type 'real'.


PsfPsfPsfPsfPsfpsf must be of image type 'real' and conform to ImageImageImageImageImageimage and FilteredImageFilteredImageFilteredImageFilteredImageFilteredImagefilteredImage in image width and height.



ImageImageImageImageImageimage (input_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Corrupted image.

PsfPsfPsfPsfPsfpsf (input_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject (real)

impulse response (PSF) of degradation (in spatial domain).

FilteredImageFilteredImageFilteredImageFilteredImageFilteredImagefilteredImage (input_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Smoothed version of corrupted image.

RestoredImageRestoredImageRestoredImageRestoredImageRestoredImagerestoredImage (output_object)  image objectHImageHImageHImageHImageXHobject * (real)

Restored image.

Example (C)

/* Restoration of a noisy image (size=256x256), that was blurred by motion*/
Hobject object;
Hobject restored;
Hobject psf;
Hobject noisefiltered;
/* 1. Generate a Point-Spread-Function for a motion-blur with       */
/*    parameter a=10 and direction along the x-axis                 */
/* 2. Noisefiltering of the image                                   */
/* 3. Wiener-filtering                                              */


wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter returns with an error message.

Possible Predecessors

gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion, simulate_motionsimulate_motionSimulateMotionsimulate_motionSimulateMotionSimulateMotion, simulate_defocussimulate_defocusSimulateDefocussimulate_defocusSimulateDefocusSimulateDefocus, gen_psf_defocusgen_psf_defocusGenPsfDefocusgen_psf_defocusGenPsfDefocusGenPsfDefocus, optimize_fft_speedoptimize_fft_speedOptimizeFftSpeedoptimize_fft_speedOptimizeFftSpeedOptimizeFftSpeed



See also

simulate_motionsimulate_motionSimulateMotionsimulate_motionSimulateMotionSimulateMotion, gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion, simulate_defocussimulate_defocusSimulateDefocussimulate_defocusSimulateDefocusSimulateDefocus, gen_psf_defocusgen_psf_defocusGenPsfDefocusgen_psf_defocusGenPsfDefocusGenPsfDefocus


M. Lückenhaus:“Grundlagen des Wiener-Filters und seine Anwendung in der Bildanalyse”; Diplomarbeit; Technische Universität München, Institut für Informatik; Lehrstuhl Prof. Radig; 1995
Azriel Rosenfeld, Avinash C. Kak: Digital Picture Processing, Computer Science and Aplied Mathematics, Academic Press New York/San Francisco/London 1982



ClassesClassesClassesClasses | | | | Operators