ImageDev

InterlaceFrames2d

Merges two images, considered as even and odd frames, to produce an interlaced image.

Access to parameter description

This algorithm generates an interlaced output image from two input images. Each even row of the output image is taken from the first input image, while each odd row is taken from the second input image.

See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
interlaceFrames2d( std::shared_ptr< iolink::ImageView > inputEvenImage,
                   std::shared_ptr< iolink::ImageView > inputOddImage,
                   InterlaceFrames2d::SplitMode splitMode,
                   std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
interlace_frames_2d( input_even_image,
                     input_odd_image,
                     split_mode = InterlaceFrames2d.SplitMode.HALF_IMAGE,
                     output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
InterlaceFrames2d( IOLink.ImageView inputEvenImage,
                   IOLink.ImageView inputOddImage,
                   InterlaceFrames2d.SplitMode splitMode = ImageDev.InterlaceFrames2d.SplitMode.HALF_IMAGE,
                   IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name InterlaceFrames2d

Parameter Name Description Type Supported Values Default Value
input
inputEvenImage
The input even field image. Image Binary, Label, Grayscale or Multispectral nullptr
input
inputOddImage
The input odd field image. It must have same dimensions and type as the even field. Image Binary, Label, Grayscale or Multispectral nullptr
input
splitMode
The split mode for generating the output image.
HALF_IMAGE This mode considers both input images as having half the Y size of the output image. The whole information of both input images is preserved by this mode.
FULL_IMAGE This mode considers both input images as having the same size as the output image by ignoring every second horizontal line. One row out of two from each input image is lost with this mode.
Enumeration HALF_IMAGE
output
outputImage
The output image. Image nullptr

Object Examples

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

InterlaceFrames2d interlaceFrames2dAlgo;
interlaceFrames2dAlgo.setInputEvenImage( polystyrene );
interlaceFrames2dAlgo.setInputOddImage( polystyrene );
interlaceFrames2dAlgo.setSplitMode( InterlaceFrames2d::SplitMode::HALF_IMAGE );
interlaceFrames2dAlgo.execute();

std::cout << "outputImage:" << interlaceFrames2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

interlace_frames_2d_algo = imagedev.InterlaceFrames2d()
interlace_frames_2d_algo.input_even_image = polystyrene
interlace_frames_2d_algo.input_odd_image = polystyrene
interlace_frames_2d_algo.split_mode = imagedev.InterlaceFrames2d.HALF_IMAGE
interlace_frames_2d_algo.execute()

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

InterlaceFrames2d interlaceFrames2dAlgo = new InterlaceFrames2d
{
    inputEvenImage = polystyrene,
    inputOddImage = polystyrene,
    splitMode = InterlaceFrames2d.SplitMode.HALF_IMAGE
};
interlaceFrames2dAlgo.Execute();

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

Function Examples

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

auto result = interlaceFrames2d( polystyrene, polystyrene, InterlaceFrames2d::SplitMode::HALF_IMAGE );

std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.interlace_frames_2d( polystyrene, polystyrene, imagedev.InterlaceFrames2d.HALF_IMAGE )

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

IOLink.ImageView result = Processing.InterlaceFrames2d( polystyrene, polystyrene, InterlaceFrames2d.SplitMode.HALF_IMAGE );

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