KlassenKlassenKlassenKlassen | | | | Operatoren

binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter (Operator)

Name

binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter — Glättung eines Bildes mit dem Binomialfilter.

Signatur

binomial_filter(Image : ImageBinomial : MaskWidth, MaskHeight : )

Herror binomial_filter(const Hobject Image, Hobject* ImageBinomial, const Hlong MaskWidth, const Hlong MaskHeight)

Herror T_binomial_filter(const Hobject Image, Hobject* ImageBinomial, const Htuple MaskWidth, const Htuple MaskHeight)

Herror binomial_filter(Hobject Image, Hobject* ImageBinomial, const HTuple& MaskWidth, const HTuple& MaskHeight)

HImage HImage::BinomialFilter(const HTuple& MaskWidth, const HTuple& MaskHeight) const

HImageArray HImageArray::BinomialFilter(const HTuple& MaskWidth, const HTuple& MaskHeight) const

void BinomialFilter(const HObject& Image, HObject* ImageBinomial, const HTuple& MaskWidth, const HTuple& MaskHeight)

HImage HImage::BinomialFilter(Hlong MaskWidth, Hlong MaskHeight) const

void HOperatorSetX.BinomialFilter(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageBinomial, [in] VARIANT MaskWidth, [in] VARIANT MaskHeight)

IHImageX* HImageX.BinomialFilter(
[in] Hlong MaskWidth, [in] Hlong MaskHeight)

static void HOperatorSet.BinomialFilter(HObject image, out HObject imageBinomial, HTuple maskWidth, HTuple maskHeight)

HImage HImage.BinomialFilter(int maskWidth, int maskHeight)

Beschreibung

binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter glättet das Bild ImageImageImageImageImageimage mit einem Binomialfilter mit einer Maskengröße von MaskWidthMaskWidthMaskWidthMaskWidthMaskWidthmaskWidth * MaskHeightMaskHeightMaskHeightMaskHeightMaskHeightmaskHeight Pixeln und liefert das geglättete Bild in ImageBinomialImageBinomialImageBinomialImageBinomialImageBinomialimageBinomial zurück. Der Binomialfilter ist eine sehr gute Annäherung eines Gaußfilters, die extrem effizient mit ganzzahligen Operationen berechnet werden kann. Daher ist binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter sehr schnell. Sei m = MaskHeightMaskHeightMaskHeightMaskHeightMaskHeightmaskHeight und n = MaskWidthMaskWidthMaskWidthMaskWidthMaskWidthmaskWidth. Dann sind die Filterkoeffizienten b_ij durch Binomialkoeffizienten

/ l \      l!
|   | = ---------
\ k /   k! (l-k)!

wie folgt gegeben:

       1     / m-1 \ / n-1 \
b   = ------ |     | |     |
 ij    n+m-2 \  i  / \  j  /
      2

Hierbei ist i = 0, ..., m-1 und j = 0, ..., n-1. Der Binomialfilter führt näherungsweise dieselbe Glättung durch wie ein Gaußfilter mit sigma = sqrt(n-1)/2, wobei der Einfachheit halber m = n angenommen wird. Im Detail ist der Zusammenhang zwischen n und sigma wie folgt:

 n  |  sigma
-------------
 3  |  0.7523
 5  |  1.0317
 7  |  1.2505
 9  |  1.4365
11  |  1.6010
13  |  1.7502
15  |  1.8876
17  |  2.0157
19  |  2.1361
21  |  2.2501
23  |  2.3586
25  |  2.4623
27  |  2.5618
29  |  2.6576
31  |  2.7500
33  |  2.8395
35  |  2.9262
37  |  3.0104

Falls unterschiedliche Werte für MaskHeightMaskHeightMaskHeightMaskHeightMaskHeightmaskHeight und MaskWidthMaskWidthMaskWidthMaskWidthMaskWidthmaskWidth gewählt werden, stimmt der obige Zusammenhang zwischen n und sigma immer noch und bezieht sich auf die Stärke der Glättung in Zeilen- und Spaltenrichtung.

binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter kann auf OpenCL Geräten ausgeführt werden.

Parallelisierung

Parameter

ImageImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte* / uint2* / real*) *erlaubt für Compute Devices

Eingabebild.

ImageBinomialImageBinomialImageBinomialImageBinomialImageBinomialimageBinomial (output_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Geglättetes Bild.

MaskWidthMaskWidthMaskWidthMaskWidthMaskWidthmaskWidth (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Filterbreite.

Defaultwert: 5

Werteliste: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37

MaskHeightMaskHeightMaskHeightMaskHeightMaskHeightmaskHeight (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Filterhöhe.

Defaultwert: 5

Werteliste: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37

Ergebnis

Sind die Parameterwerte korrekt, dann liefert binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter den Wert 2 (H_MSG_TRUE). Das Verhalten bei leerer Eingabe (keine Eingabebilder vorhanden) lässt sich mittels set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

read_imageread_imageReadImageread_imageReadImageReadImage, grab_imagegrab_imageGrabImagegrab_imageGrabImageGrabImage

Nachfolger

regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, thresholdthresholdThresholdthresholdThresholdThreshold, sub_imagesub_imageSubImagesub_imageSubImageSubImage, dyn_thresholddyn_thresholdDynThresholddyn_thresholdDynThresholdDynThreshold, auto_thresholdauto_thresholdAutoThresholdauto_thresholdAutoThresholdAutoThreshold

Alternativen

gauss_imagegauss_imageGaussImagegauss_imageGaussImageGaussImage, smooth_imagesmooth_imageSmoothImagesmooth_imageSmoothImageSmoothImage, derivate_gaussderivate_gaussDerivateGaussderivate_gaussDerivateGaussDerivateGauss, isotropic_diffusionisotropic_diffusionIsotropicDiffusionisotropic_diffusionIsotropicDiffusionIsotropicDiffusion

Siehe auch

mean_imagemean_imageMeanImagemean_imageMeanImageMeanImage, anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusion, sigma_imagesigma_imageSigmaImagesigma_imageSigmaImageSigmaImage, gen_lowpassgen_lowpassGenLowpassgen_lowpassGenLowpassGenLowpass

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren