rotate_imagerotate_imageRotateImageRotateImagerotate_image (Operator)

Name

rotate_imagerotate_imageRotateImageRotateImagerotate_image — Rotieren von Bildern um das Zentrum.

Signatur

rotate_image(Image : ImageRotate : Phi, Interpolation : )

Herror rotate_image(const Hobject Image, Hobject* ImageRotate, double Phi, const char* Interpolation)

Herror T_rotate_image(const Hobject Image, Hobject* ImageRotate, const Htuple Phi, const Htuple Interpolation)

void RotateImage(const HObject& Image, HObject* ImageRotate, const HTuple& Phi, const HTuple& Interpolation)

HImage HImage::RotateImage(const HTuple& Phi, const HString& Interpolation) const

HImage HImage::RotateImage(double Phi, const HString& Interpolation) const

HImage HImage::RotateImage(double Phi, const char* Interpolation) const

HImage HImage::RotateImage(double Phi, const wchar_t* Interpolation) const   (Nur Windows)

static void HOperatorSet.RotateImage(HObject image, out HObject imageRotate, HTuple phi, HTuple interpolation)

HImage HImage.RotateImage(HTuple phi, string interpolation)

HImage HImage.RotateImage(double phi, string interpolation)

def rotate_image(image: HObject, phi: Union[int, float], interpolation: str) -> HObject

Beschreibung

rotate_imagerotate_imageRotateImageRotateImageRotateImagerotate_image dreht das Bild ImageImageImageImageimageimage gegen den Uhrzeigersinn um PhiPhiPhiPhiphiphi Grad um den Bildmittelpunkt und gibt das Ergebnis im Ausgabebild ImageRotateImageRotateImageRotateImageRotateimageRotateimage_rotate zurück. Das Ausgabebild hat die gleiche Größe wie das Eingabebild. Die einzigen Ausnahmen sind Drehungen um 90 und 270 Grad, wo Breite und Höhe vertauscht werden. Der Definitionsbereich des Eingabebildes wird ignoriert, d.h., als das volle Rechteck des Bildes angenommen. Der Definitionsbereich des Ausgabebildes entspricht der Überschneidung des transformierten Rechtecks und des Rechtecks des Ausgabebildes.

Falls PhiPhiPhiPhiphiphi ein Vielfaches von 90 Grad ist, ist dieser Operator viel schneller als der allgemeine Operator affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image. Der Parameter InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation entspricht der Wirkung bei affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image. Bei Rotationen um 90, 180 und 270 Grad wird der Parameter ignoriert. Wenn es erforderlich ist, den Definitionsbereich ebenfalls mit zu rotieren, muss der Operator projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImageprojective_trans_image genutzt werden.

Für Bilder vom Typ byte, int2 oder uint2 kann mittels des Systemparameters 'int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming""int_zooming" (siehe set_systemset_systemSetSystemSetSystemSetSystemset_system) zwischen schneller Berechnung in Festkommaarithmetik ('int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming""int_zooming" = 'true'"true""true""true""true""true") und hochgenauer Berechnung in Fließkommaarithmetik ('int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming""int_zooming" = 'false'"false""false""false""false""false") gewählt werden. Mit Ausnahme der Rotationen um 90, 180 oder 270 Grad kann es bei der Festkommaberechnung zu leichten Grauwertabweichungen kommen. Auch die Domäne der Ergebnisbilder kann sich in diesem Fall leicht unterscheiden.

Achtung

Der Definitionsbereich des Eingabebildes wird ignoriert, d.h., als das volle Rechteck des Bildes angenommen. Der Definitionsbereich des Ausgabebildes entspricht der Überschneidung des transformierten Rechtecks und des Rechtecks des Ausgabebildes. Der Winkel PhiPhiPhiPhiphiphi wird in Grad und nicht im Bogenmaß angegeben. rotate_imagerotate_imageRotateImageRotateImageRotateImagerotate_image wird für Rotationen um 90, 180 und 270 Grad nicht intern parallelisiert!

rotate_imagerotate_imageRotateImageRotateImageRotateImagerotate_image 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.

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

Rotiertes Ausgabebild.

PhiPhiPhiPhiphiphi (input_control)  angle.deg HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Rotationswinkel.

Defaultwert: 90

Wertevorschläge: 90, 180, 270

Typischer Wertebereich: 0 ≤ Phi Phi Phi Phi phi phi ≤ 360

Minimale Schrittweite: 0.001

Empfohlene Schrittweite: 0.2

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)
rotate_image(Image,RotImage,270,'constant')
dev_display (RotImage)

Beispiel (C)

read_image(&Image,"monkey");
disp_image(Image,WindowHandle);
rotate_image(Image,&RotImage,270,'constant');
disp_image(RotImage,WindowHandle);

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
rotate_image(Image,RotImage,270,'constant')
dev_display (RotImage)

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
rotate_image(Image,RotImage,270,'constant')
dev_display (RotImage)

Beispiel (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
rotate_image(Image,RotImage,270,'constant')
dev_display (RotImage)

Alternativen

hom_mat2d_rotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotateHomMat2dRotatehom_mat2d_rotate, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image

Siehe auch

mirror_imagemirror_imageMirrorImageMirrorImageMirrorImagemirror_image

Modul

Foundation