binomial_filterbinomial_filterBinomialFilterBinomialFilterbinomial_filter (Operator)

Name

binomial_filterbinomial_filterBinomialFilterBinomialFilterbinomial_filter — 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)

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

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

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

HImage HImage.BinomialFilter(int maskWidth, int maskHeight)

def binomial_filter(image: HObject, mask_width: int, mask_height: int) -> HObject

Beschreibung

binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter glättet das Bild ImageImageImageImageimageimage mit einem Binomialfilter mit einer Maskengröße von MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width * MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height Pixeln und liefert das geglättete Bild in ImageBinomialImageBinomialImageBinomialImageBinomialimageBinomialimage_binomial 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_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter sehr schnell. Sei m = MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height und n = MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width. Dann sind die Filterkoeffizienten durch Binomialkoeffizienten wie folgt gegeben: 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 , wobei der Einfachheit halber m = n angenommen wird. Im Detail ist der Zusammenhang zwischen n und wie folgt:
n
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 MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height und MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width gewählt werden, stimmt der obige Zusammenhang zwischen n und immer noch und bezieht sich auf die Stärke der Glättung in Zeilen- und Spaltenrichtung.

binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter kann auf OpenCL-Geräten ausgeführt werden.

Das Konzept der Glättungsfilter ist in der Einleitung zum Kapitel Filter / Glättung beschrieben.

Achtung

Beachten Sie, dass Filteroperatoren eventuell unerwartete Resultate ausgeben, wenn ein Bild mit einer reduzierten Domäne als Input übergeben wird. Weitere Informationen können im Kapitel Filter gefunden werden.

Ausführungsinformationen

Parameter

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

Eingabebild.

ImageBinomialImageBinomialImageBinomialImageBinomialimageBinomialimage_binomial (output_object)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / uint2 / real)

Geglättetes Bild.

MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (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

MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (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_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter 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>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

read_imageread_imageReadImageReadImageReadImageread_image, grab_imagegrab_imageGrabImageGrabImageGrabImagegrab_image

Nachfolger

regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, thresholdthresholdThresholdThresholdThresholdthreshold, sub_imagesub_imageSubImageSubImageSubImagesub_image, dyn_thresholddyn_thresholdDynThresholdDynThresholdDynThresholddyn_threshold, auto_thresholdauto_thresholdAutoThresholdAutoThresholdAutoThresholdauto_threshold

Alternativen

gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter, smooth_imagesmooth_imageSmoothImageSmoothImageSmoothImagesmooth_image, derivate_gaussderivate_gaussDerivateGaussDerivateGaussDerivateGaussderivate_gauss, isotropic_diffusionisotropic_diffusionIsotropicDiffusionIsotropicDiffusionIsotropicDiffusionisotropic_diffusion

Siehe auch

mean_imagemean_imageMeanImageMeanImageMeanImagemean_image, anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusionAnisotropicDiffusionanisotropic_diffusion, sigma_imagesigma_imageSigmaImageSigmaImageSigmaImagesigma_image, gen_lowpassgen_lowpassGenLowpassGenLowpassGenLowpassgen_lowpass

Modul

Foundation