rotate_imagerotate_imageRotateImageRotateImagerotate_image (算子)

名称

rotate_imagerotate_imageRotateImageRotateImagerotate_image — 围绕图像中心旋转图像。

签名

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   ( Windows only)

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

描述

rotate_imagerotate_imageRotateImageRotateImageRotateImagerotate_image rotates the ImageImageImageImageimageimage counterclockwise by PhiPhiPhiPhiphiphi degrees about its center and stores the result in the output image ImageRotateImageRotateImageRotateImageRotateimageRotateimage_rotate. The output image has the same size as the input image. The only exception are rotations by 90 and 270 degrees where width and height will be exchanged. The domain of the input image is ignored, i.e., assumed to be the full rectangle of the image. The domain of the output image is the intersection of the transformed rectangle and the rectangle of the output image.

If PhiPhiPhiPhiphiphi is a multiple of 90 degrees, this operator is much faster, especially than the general operator affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image。The effect of the parameter InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation is the same as in affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image。It is ignored for rotations by 90, 180, and 270 degrees. If it is necessary to rotate the domain, too, the operator projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImageprojective_trans_image must be used.

Additionally, for images of type 'byte'"byte""byte""byte""byte""byte", 'int2'"int2""int2""int2""int2""int2" or 'uint2'"uint2""uint2""uint2""uint2""uint2" the system parameter 'int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming""int_zooming" selects between fast calculation in fixed point arithmetics ('int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming""int_zooming" = 'true'"true""true""true""true""true") and highly accurate calculation in floating point arithmetics ('int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming""int_zooming" = 'false'"false""false""false""false""false"). Except for rotations by 90, 180, or 270 degrees, fixed point calculation can lead to minor gray value deviations. Furthermore, the domain of resulting images can differ as well.

注意

The domain of the input image is ignored, i.e., assumed to be the full rectangle of the image. The domain of the output image is the intersection of the transformed rectangle and the rectangle of the output image. The angle PhiPhiPhiPhiphiphi is given in degrees, not in radians. For rotations by 90, 180, and 270 degrees rotate_imagerotate_imageRotateImageRotateImageRotateImagerotate_image is not parallelized internally.

rotate_imagerotate_imageRotateImageRotateImageRotateImagerotate_image can be executed on OpenCL devices if the input image does not exceed the maximum size of image objects of the selected device. Due to numerical reasons, there can be slight differences in the output compared to the execution on the CPU.

执行信息

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte* / int2* / uint2* / real*) *允许用于计算设备

输入图像。

ImageRotateImageRotateImageRotateImageRotateimageRotateimage_rotate (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / int2 / uint2 / real)

Rotated image.

PhiPhiPhiPhiphiphi (输入控制)  angle.deg HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Rotation angle.

默认值: 90

建议值: 90, 180, 270

值范围: 0 ≤ Phi Phi Phi Phi phi phi ≤ 360

最小增量: 0.001

建议增量: 0.2

InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

插值类型。

默认值: 'constant' "constant" "constant" "constant" "constant" "constant"

值列表: '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"

示例(HDevelop)

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

示例(C)

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

示例(HDevelop)

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

示例(HDevelop)

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

示例(HDevelop)

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

替代

hom_mat2d_rotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotateHomMat2dRotatehom_mat2d_rotate, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image

另见

mirror_imagemirror_imageMirrorImageMirrorImageMirrorImagemirror_image

模块

基础