Processing math: 100%
ImageDev

FlipImage2d

Flips a two-dimensional image along the X axis, Y axis, or the image center.

Access to parameter description

This algorithm generates an output image according to the selected axis of symmetry, as explained in the axis parameter description.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > flipImage2d( std::shared_ptr< iolink::ImageView > inputImage, FlipImage2d::Axis axis, std::shared_ptr< iolink::ImageView > outputImage = nullptr );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
axis
The symmetry type.
X_AXIS The flip transformation is relative to an axis parallel to X. The result is given by: O(x,y)=I(x,N+1y) where N is the Y image size.
Y_AXIS The flip transformation is relative to an axis parallel to Y. The result is given by: O(x,y)=I(M+1x,y) where M is the X image size.
CENTER The flip transformation is relative to the center of the image. The result is given by: O(x,y)=I(M+1x,N+1y) where M is the X image size and N is the Y image size.
Enumeration X_AXIS
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

FlipImage2d flipImage2dAlgo;
flipImage2dAlgo.setInputImage( polystyrene );
flipImage2dAlgo.setAxis( FlipImage2d::Axis::X_AXIS );
flipImage2dAlgo.execute();

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

Function Examples

auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = flipImage2d( polystyrene, FlipImage2d::Axis::X_AXIS );

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