zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactor (Operator)

Name

zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactor — Skalieren von Bildern um einen Vergrößerungsfaktor.

Signatur

zoom_image_factor(Image : ImageZoomed : ScaleWidth, ScaleHeight, Interpolation : )

Herror zoom_image_factor(const Hobject Image, Hobject* ImageZoomed, double ScaleWidth, double ScaleHeight, const char* Interpolation)

Herror T_zoom_image_factor(const Hobject Image, Hobject* ImageZoomed, const Htuple ScaleWidth, const Htuple ScaleHeight, const Htuple Interpolation)

void ZoomImageFactor(const HObject& Image, HObject* ImageZoomed, const HTuple& ScaleWidth, const HTuple& ScaleHeight, const HTuple& Interpolation)

HImage HImage::ZoomImageFactor(double ScaleWidth, double ScaleHeight, const HString& Interpolation) const

HImage HImage::ZoomImageFactor(double ScaleWidth, double ScaleHeight, const char* Interpolation) const

HImage HImage::ZoomImageFactor(double ScaleWidth, double ScaleHeight, const wchar_t* Interpolation) const   (Nur Windows)

static void HOperatorSet.ZoomImageFactor(HObject image, out HObject imageZoomed, HTuple scaleWidth, HTuple scaleHeight, HTuple interpolation)

HImage HImage.ZoomImageFactor(double scaleWidth, double scaleHeight, string interpolation)

Beschreibung

zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactorZoomImageFactor vergrößert das Bild ImageImageImageImageimage um einen Faktor ScaleWidthScaleWidthScaleWidthScaleWidthscaleWidth in der Breite und einen Faktor ScaleHeightScaleHeightScaleHeightScaleHeightscaleHeight in der Höhe. Der Parameter InterpolationInterpolationInterpolationInterpolationinterpolation gibt dabei die Art der verwendeten Interpolationsmethode an (siehe affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImage). Die Domäne des Eingabebildes wird ignoriert, d.h. es wird die volle Domäne des Bildrechtecks angenommen.

Achtung

Falls der Systemparameter 'int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming" auf 'true'"true""true""true""true" gesetzt ist, kann die intern verwendete Integer-Arithmetik in den folgenden beiden Fällen zu Fehlern führen: Zum einen kann das Ergebnisbild leicht fehlerhafte Grauwerte enthalten, wenn zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactorZoomImageFactor auf ein uint2 oder int2 Bild mit hohem Dynamikbereich (das heißt, Bilder mit Werten nahe an den Grenzen der entsprechenden Typen) angewendet wird und gleichzeitig Skalierungsfaktoren kleiner als 0.5 verwendet werden. Zum zweiten können undefinierte Grauwerte am unteren und am rechten Bildrand entstehen, wenn für InterpolationInterpolationInterpolationInterpolationinterpolation ein anderer Wert als 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" gewählt wird, ein großer Skalierungsfaktor angewendet wird und außerdem ein großes Ergebnisbild entsteht. Die maximale Breite dieses Randes mit undefinierten Grauwerten kann mit der Formel abgeschätzt werden, wobei S den Skalierungsfaktor in einer Dimension und I die Größe des Ausgabebildes in der entsprechenden Dimension darstellt. In beiden Fällen wird empfohlen, den Systemparameter 'int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming" mittels set_systemset_systemSetSystemSetSystemSetSystem auf 'false'"false""false""false""false" zu setzen.

zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactorZoomImageFactor wird für ScaleWidthScaleWidthScaleWidthScaleWidthscaleWidth = 0.5 und ScaleHeightScaleHeightScaleHeightScaleHeightscaleHeight = 0.5 nicht intern parallelisiert. Außerdem erfolgt keine interne Parallelisierung für InterpolationInterpolationInterpolationInterpolationinterpolation='nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor".

zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactorZoomImageFactor kann auf OpenCL Geräten ausgeführt werden, wenn das Eingangsbild die maximale Größe für Bildobjekte des ausgewählten Gerätes nicht überschreitet. Aus numerischen Gründen kann es dabei zu geringfügigen Abweichungen des Ergebnisses gegenüber der Ausführung auf der CPU kommen.

Ausführungsinformationen

Parameter

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHobject (byte* / int2* / uint2* / real*) *erlaubt für Compute Devices

Eingabebild.

ImageZoomedImageZoomedImageZoomedImageZoomedimageZoomed (output_object)  (multichannel-)image(-array) objectHImageHImageHobject * (byte / int2 / uint2 / real)

Skaliertes Ausgabebild.

ScaleWidthScaleWidthScaleWidthScaleWidthscaleWidth (input_control)  extent.x HTupleHTupleHtuple (real) (double) (double) (double)

Faktor für Breite des Zielbildes.

Defaultwert: 0.5

Wertevorschläge: 0.25, 0.5, 1.5, 2.0

Typischer Wertebereich: 0.001 ≤ ScaleWidth ScaleWidth ScaleWidth ScaleWidth scaleWidth ≤ 10.0

Minimale Schrittweite: 0.001

Empfohlene Schrittweite: 0.1

ScaleHeightScaleHeightScaleHeightScaleHeightscaleHeight (input_control)  extent.y HTupleHTupleHtuple (real) (double) (double) (double)

Faktor für Höhe des Zielbildes.

Defaultwert: 0.5

Wertevorschläge: 0.25, 0.5, 1.5, 2.0

Typischer Wertebereich: 0.001 ≤ ScaleHeight ScaleHeight ScaleHeight ScaleHeight scaleHeight ≤ 10.0

Minimale Schrittweite: 0.001

Empfohlene Schrittweite: 0.1

InterpolationInterpolationInterpolationInterpolationinterpolation (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Art der Interpolation.

Defaultwert: 'constant' "constant" "constant" "constant" "constant"

Werteliste: 'bicubic'"bicubic""bicubic""bicubic""bicubic", 'bilinear'"bilinear""bilinear""bilinear""bilinear", 'constant'"constant""constant""constant""constant", 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", 'weighted'"weighted""weighted""weighted""weighted"

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Beispiel (C)

read_image(&Image,"monkey");
disp_image(Image,WindowHandle);
zoom_image_factor(Image,&ZooImage,0.25,0.25,"constant");
disp_image(ZooImage,WindowHandle);

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Alternativen

zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSize, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImage, hom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScaleHomMat2dScale

Siehe auch

hom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScaleHomMat2dScale, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImage

Modul

Foundation