Rotate2d
Applies a rotation of a given angle on a two-dimensional image arround a given point or the center of the image.
Access to parameter description

Figure 1. The angle corresponds to this convention for defining the orientation
Access to parameter description

Figure 1. The angle corresponds to this convention for defining the orientation
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > rotate2d( std::shared_ptr< iolink::ImageView > inputImage, double rotationAngle, Rotate2d::CenterMode centerMode, iolink::Vector2d rotationCenter, Rotate2d::InterpolationType interpolationType, bool outputResizing, double paddingValue, std::shared_ptr< iolink::ImageView > outputImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | nullptr | ||||
![]() |
rotationAngle |
The angle of the rotation in degrees. | Float64 | Any value | 90 | ||||
![]() |
centerMode |
The way to define the rotation center
|
Enumeration | IMAGE_CENTER | |||||
![]() |
rotationCenter |
The rotation center coordinates. This parameter is ignored in IMAGE_CENTER mode. | Vector2d | Any value | {0.f, 0.f} | ||||
![]() |
interpolationType |
The interpolation mode. Method used to calculate the intensity of each pixel in the result image.
|
Enumeration | NEAREST_NEIGHBOR | |||||
![]() |
outputResizing |
Resize the output image to make all input data visible in the output image if set to True. Preserve the input dimension if set to False. | Bool | true | |||||
![]() |
paddingValue |
The background value for pixels with no correpondant point in the input image. | Float64 | Any value | 0 | ||||
![]() |
outputImage |
The output image. Its type is forced to the same values as the input. Its dimensions are identical to or greater than the input image, according to the outputResizing parameter. | Image | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); Rotate2d rotate2dAlgo; rotate2dAlgo.setInputImage( polystyrene ); rotate2dAlgo.setRotationAngle( 40.5 ); rotate2dAlgo.setCenterMode( Rotate2d::CenterMode::IMAGE_CENTER ); rotate2dAlgo.setRotationCenter( {15.5, 32} ); rotate2dAlgo.setInterpolationType( Rotate2d::InterpolationType::NEAREST_NEIGHBOR ); rotate2dAlgo.setOutputResizing( true ); rotate2dAlgo.setPaddingValue( 0 ); rotate2dAlgo.execute(); std::cout << "outputImage:" << rotate2dAlgo.outputImage()->toString();
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = rotate2d( polystyrene, 40.5, Rotate2d::CenterMode::IMAGE_CENTER, {15.5, 32}, Rotate2d::InterpolationType::NEAREST_NEIGHBOR, true, 0 ); std::cout << "outputImage:" << result->toString();