HALCON Reference Manual 10.0.2
Table of Contents / Filters / Geometric Transformations ClassesClassesClasses | | | Operators

rotate_imagerotate_imagerotate_imageRotateImageRotateImage (Operator)

Name

rotate_imagerotate_imagerotate_imageRotateImageRotateImage — Rotate an image about its center.

Signature

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)

Herror rotate_image(Hobject Image, Hobject* ImageRotate, const HTuple& Phi, const HTuple& Interpolation)

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

HImageArray HImageArray::RotateImage(const HTuple& Phi, const HTuple& Interpolation) const

void HOperatorSetX.RotateImage(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageRotate, [in] VARIANT Phi, [in] VARIANT Interpolation)

IHImageX* HImageX.RotateImage(
[in] VARIANT Phi, [in] BSTR Interpolation)

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)

Description

rotate_imagerotate_imagerotate_imageRotateImageRotateImage rotates the ImageImageImageImageimage counterclockwise by PhiPhiPhiPhiphi degrees about its center and stores the result in the output image ImageRotateImageRotateImageRotateImageRotateimageRotate. 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 ouput image.

If PhiPhiPhiPhiphi is a multiple of 90 degrees, this operator is much faster, especially than the general operator affine_trans_imageaffine_trans_imageaffine_trans_imageAffineTransImageAffineTransImage. The effect of the parameter InterpolationInterpolationInterpolationInterpolationinterpolation is the same as in affine_trans_imageaffine_trans_imageaffine_trans_imageAffineTransImageAffineTransImage. 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_imageprojective_trans_imageProjectiveTransImageProjectiveTransImage has to be used.

Attention

The domain of the input image is ingnored, 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 PhiPhiPhiPhiphi is given in degrees, not in radians. For rotations by 90, 180, and 270 degrees rotate_imagerotate_imagerotate_imageRotateImageRotateImage is not parallelized internally!

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

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte* / int2* / uint2* / real*) *allowed for compute devices

Input image.

ImageRotateImageRotateImageRotateImageRotateimageRotate (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte / int2 / uint2 / real)

Rotated image.

PhiPhiPhiPhiphi (input_control)  angle.deg HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Rotation angle.

Default value: 90

Suggested values: 90, 180, 270

Typical range of values: 0 ≤ Phi Phi Phi Phi phi ≤ 360

Minimum increment: 0.001

Recommended increment: 0.2

InterpolationInterpolationInterpolationInterpolationinterpolation (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Type of interpolation.

Default value: 'constant' "constant" "constant" "constant" "constant"

List of values: 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", 'bilinear'"bilinear""bilinear""bilinear""bilinear", 'constant'"constant""constant""constant""constant", 'weighted'"weighted""weighted""weighted""weighted"

Example (HDevelop)

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

Example (C)

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

Example (HDevelop)

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

Example (HDevelop)

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

Example (HDevelop)

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

Alternatives

hom_mat2d_rotatehom_mat2d_rotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotate, affine_trans_imageaffine_trans_imageaffine_trans_imageAffineTransImageAffineTransImage

See also

mirror_imagemirror_imagemirror_imageMirrorImageMirrorImage

Module

Foundation


Table of Contents / Filters / Geometric Transformations ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH