ImageDev

RotateCenterImage2d

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

Access to parameter description

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 the outputImage output parameter.
// 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 );
This function returns the outputImage output parameter.
// Function prototype.
rotate_center_image_2d( input_image,
                        rotation_angle = 10,
                        interpolation_type = RotateCenterImage2d.InterpolationType.NEAREST_NEIGHBOR,
                        output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
RotateCenterImage2d( IOLink.ImageView inputImage,
                     double rotationAngle = 10,
                     RotateCenterImage2d.InterpolationType interpolationType = ImageDev.RotateCenterImage2d.InterpolationType.NEAREST_NEIGHBOR,
                     IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name RotateCenterImage2d

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();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

rotate_center_image_2d_algo = imagedev.RotateCenterImage2d()
rotate_center_image_2d_algo.input_image = polystyrene
rotate_center_image_2d_algo.rotation_angle = 10.0
rotate_center_image_2d_algo.interpolation_type = imagedev.RotateCenterImage2d.NEAREST_NEIGHBOR
rotate_center_image_2d_algo.execute()

print( "output_image:", str( rotate_center_image_2d_algo.output_image ) );
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

RotateCenterImage2d rotateCenterImage2dAlgo = new RotateCenterImage2d
{
    inputImage = polystyrene,
    rotationAngle = 10.0,
    interpolationType = RotateCenterImage2d.InterpolationType.NEAREST_NEIGHBOR
};
rotateCenterImage2dAlgo.Execute();

Console.WriteLine( "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();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.rotate_center_image_2d( polystyrene, 10.0, imagedev.RotateCenterImage2d.NEAREST_NEIGHBOR )

print( "output_image:", str( result ) );
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IOLink.ImageView result = Processing.RotateCenterImage2d( polystyrene, 10.0, RotateCenterImage2d.InterpolationType.NEAREST_NEIGHBOR );

Console.WriteLine( "outputImage:" + result.ToString() );