zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizezoom_image_size (Operator)

Name

zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizezoom_image_size — Skalieren von Bildern auf eine vorgegebene Größe.

Signatur

zoom_image_size(Image : ImageZoom : Width, Height, Interpolation : )

Herror zoom_image_size(const Hobject Image, Hobject* ImageZoom, const Hlong Width, const Hlong Height, const char* Interpolation)

Herror T_zoom_image_size(const Hobject Image, Hobject* ImageZoom, const Htuple Width, const Htuple Height, const Htuple Interpolation)

void ZoomImageSize(const HObject& Image, HObject* ImageZoom, const HTuple& Width, const HTuple& Height, const HTuple& Interpolation)

HImage HImage::ZoomImageSize(Hlong Width, Hlong Height, const HString& Interpolation) const

HImage HImage::ZoomImageSize(Hlong Width, Hlong Height, const char* Interpolation) const

HImage HImage::ZoomImageSize(Hlong Width, Hlong Height, const wchar_t* Interpolation) const   (Nur Windows)

static void HOperatorSet.ZoomImageSize(HObject image, out HObject imageZoom, HTuple width, HTuple height, HTuple interpolation)

HImage HImage.ZoomImageSize(int width, int height, string interpolation)

def zoom_image_size(image: HObject, width: int, height: int, interpolation: str) -> HObject

Beschreibung

zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSizezoom_image_size vergrößert das Bild ImageImageImageImageimageimage auf die durch WidthWidthWidthWidthwidthwidth und HeightHeightHeightHeightheightheight vorgegebene Größe. Der Parameter InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation gibt dabei die Art der verwendeten Interpolationsmethode an (siehe affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image). 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""int_zooming" auf 'true'"true""true""true""true""true" gesetzt ist, kann die intern verwendete Integer-Arithmetik in den folgenden drei Fällen zu Fehlern führen: Zum einen kann das Ergebnisbild leicht fehlerhafte Grauwerte enthalten, wenn zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSizezoom_image_size 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 (Verhältnis von Ausgabe- zu Eingabebildgröße) kleiner als 0.5 verwendet werden. Zum zweiten können undefinierte Grauwerte am unteren und am rechten Bildrand entstehen, wenn für InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation ein anderer Wert als 'nearest_neighbor'"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. Zum dritten können undefinierte Grauwerte an allen Bildrändern entstehen, wenn für InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" gewählt wird, es sich um ein Real-Bild handelt, und wenn sowohl Eingabe- als auch Ergebnisbild groß sind. In allen Fällen wird empfohlen, den Systemparameter 'int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming""int_zooming" mittels set_systemset_systemSetSystemSetSystemSetSystemset_system auf 'false'"false""false""false""false""false" zu setzen.

Wird 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" als Interpolationsmethode gesetzt, können die Ergebnisse für verschiedene Bildtypen leicht voneinander abweichen. Grund dafür sind Bildtyp-spezifische Optimierungen des Interpolationsverfahrens.

zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSizezoom_image_size wird nicht intern parallelisiert, wenn WidthWidthWidthWidthwidthwidth und HeightHeightHeightHeightheightheight den halben Dimensionen von ImageImageImageImageimageimage entsprechen. Außerdem erfolgt keine interne Parallelisierung für InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation='nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor".

zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSizezoom_image_size 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

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

Eingabebild

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

Skaliertes Ausgabebild.

WidthWidthWidthWidthwidthwidth (input_control)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Zielbildes.

Defaultwert: 512

Wertevorschläge: 128, 256, 512

Typischer Wertebereich: 2 ≤ Width Width Width Width width width ≤ 512

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

HeightHeightHeightHeightheightheight (input_control)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Zielbildes.

Defaultwert: 512

Wertevorschläge: 128, 256, 512

Typischer Wertebereich: 2 ≤ Height Height Height Height height height ≤ 512

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Art der Interpolation.

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

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

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_size(Image,ZoomImage,200,200,'constant')
dev_display (ZoomImage)

Beispiel (C)

read_image(&Image,"monkey");
disp_image(Image,WindowHandle);
zoom_image_size(Image,&ZoomImage,200,200,"constant");
disp_image(ZoomImage,WindowHandle);

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_size(Image,ZoomImage,200,200,'constant')
dev_display (ZoomImage)

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_size(Image,ZoomImage,200,200,'constant')
dev_display (ZoomImage)

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_size(Image,ZoomImage,200,200,'constant')
dev_display (ZoomImage)

Alternativen

zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactorZoomImageFactorzoom_image_factor, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image, hom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScaleHomMat2dScalehom_mat2d_scale

Siehe auch

hom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScaleHomMat2dScalehom_mat2d_scale, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image

Modul

Foundation