ImageDev

RotateCenterImage2d

Applies a centered rotation of a given angle on a two-dimensional image.

Access to parameter description

This command is deprecated, it will be removed in ImageDev 2024.2.
You can use Rotate2d instead.

RotateCenterImage2d performs a rotation of an image by a user-defined angle using the image center as axis of rotation.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > rotateCenterImage2d( std::shared_ptr< iolink::ImageView > inputImage, double rotationAngle, RotateCenterImage2d::InterpolationType interpolationType, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
rotationAngle
The angle of the rotation in degrees. Float64 Any value 10
input
interpolationType
The interpolation mode. Method used to calculate the intensity of each pixel in the result image.
NEAREST_NEIGHBOR Assign the gray level of the nearest pixel.
LINEAR Assign the bilinear interpolation from the four nearest pixels.
Enumeration NEAREST_NEIGHBOR
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

RotateCenterImage2d rotateCenterImage2dAlgo;
rotateCenterImage2dAlgo.setInputImage( polystyrene );
rotateCenterImage2dAlgo.setRotationAngle( 10.0 );
rotateCenterImage2dAlgo.setInterpolationType( RotateCenterImage2d::InterpolationType::NEAREST_NEIGHBOR );
rotateCenterImage2dAlgo.execute();

std::cout << "outputImage:" << rotateCenterImage2dAlgo.outputImage()->toString();

Function Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = rotateCenterImage2d( polystyrene, 10.0, RotateCenterImage2d::InterpolationType::NEAREST_NEIGHBOR );

std::cout << "outputImage:" << result->toString();