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 );
This function returns outputImage.
// Function prototype.
flip_image_2d(input_image: idt.ImageType,
              axis: FlipImage2d.Axis = FlipImage2d.Axis.X_AXIS,
              output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
FlipImage2d( IOLink.ImageView inputImage,
             FlipImage2d.Axis axis = ImageDev.FlipImage2d.Axis.X_AXIS,
             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
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+1-y) $$ 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+1-x,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+1-x,N+1-y) $$ 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
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
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+1-y) $$ 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+1-x,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+1-x,N+1-y) $$ where M is the X image size and N is the Y image size.
enumeration X_AXIS
output
output_image
The output image. Its dimensions and type are forced to the same values as the input. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
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+1-y) $$ 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+1-x,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+1-x,N+1-y) $$ 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 null

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

flip_image_2d_algo = imagedev.FlipImage2d()
flip_image_2d_algo.input_image = polystyrene
flip_image_2d_algo.axis = imagedev.FlipImage2d.X_AXIS
flip_image_2d_algo.execute()

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

FlipImage2d flipImage2dAlgo = new FlipImage2d
{
    inputImage = polystyrene,
    axis = FlipImage2d.Axis.X_AXIS
};
flipImage2dAlgo.Execute();

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

result = imagedev.flip_image_2d(polystyrene, imagedev.FlipImage2d.X_AXIS)

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

IOLink.ImageView result = Processing.FlipImage2d( polystyrene, FlipImage2d.Axis.X_AXIS );

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