zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSize (Operator)

Name

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

Beschreibung

zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSize vergrößert das Bild ImageImageImageImageimage auf die durch WidthWidthWidthWidthwidth und HeightHeightHeightHeightheight vorgegebene Größe. 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_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSize 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 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_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSize wird nicht intern parallelisiert, wenn WidthWidthWidthWidthwidth und HeightHeightHeightHeightheight den halben Dimensionen von ImageImageImageImageimage entsprechen. Außerdem erfolgt keine interne Parallelisierung für InterpolationInterpolationInterpolationInterpolationinterpolation='nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor".

zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSize 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

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

Skaliertes Ausgabebild.

WidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Zielbildes.

Defaultwert: 512

Wertevorschläge: 128, 256, 512

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

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

HeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Zielbildes.

Defaultwert: 512

Wertevorschläge: 128, 256, 512

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

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

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_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_factorZoomImageFactorZoomImageFactorZoomImageFactor, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImage, hom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScaleHomMat2dScale

Siehe auch

hom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScaleHomMat2dScale, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImage

Modul

Foundation