ImageDev

DeinterlaceFrames2d

Separates even and odd frames from an interlaced image.

Access to parameter description

This algorithm generates two output images from an interlaced input image. The first output image contains all even rows of the input image, while the second output image contains its odd rows.

See also

Function Syntax

This function returns a DeinterlaceFrames2dOutput structure containing outputEvenImage and outputOddImage.
// Output structure of the deinterlaceFrames2d function.
struct DeinterlaceFrames2dOutput
{
    /// The output even field image.
    std::shared_ptr< iolink::ImageView > outputEvenImage;
    /// The output odd field image.
    std::shared_ptr< iolink::ImageView > outputOddImage;
};

// Function prototype
DeinterlaceFrames2dOutput deinterlaceFrames2d( std::shared_ptr< iolink::ImageView > inputImage, DeinterlaceFrames2d::SplitMode splitMode, std::shared_ptr< iolink::ImageView > outputEvenImage = NULL, std::shared_ptr< iolink::ImageView > outputOddImage = NULL );
This function returns a tuple containing output_even_image and output_odd_image.
// Function prototype.
deinterlace_frames_2d( input_image,
                       split_mode = DeinterlaceFrames2d.SplitMode.HALF_IMAGE,
                       output_even_image = None,
                       output_odd_image = None )
This function returns a DeinterlaceFrames2dOutput structure containing outputEvenImage and outputOddImage.
/// Output structure of the DeinterlaceFrames2d function.
public struct DeinterlaceFrames2dOutput
{
    /// The output even field image.
    public IOLink.ImageView outputEvenImage;
    /// The output odd field image.
    public IOLink.ImageView outputOddImage;
};

// Function prototype.
public static DeinterlaceFrames2dOutput
DeinterlaceFrames2d( IOLink.ImageView inputImage,
                     DeinterlaceFrames2d.SplitMode splitMode = ImageDev.DeinterlaceFrames2d.SplitMode.HALF_IMAGE,
                     IOLink.ImageView outputEvenImage = null,
                     IOLink.ImageView outputOddImage = null );

Class Syntax

Parameters

Class Name DeinterlaceFrames2d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
splitMode
The split mode for generating the output images.
HALF_IMAGE This mode produces two images having half the Y size of the input image.
FULL_IMAGE This mode produces two images having the same size as the input image by repeating every second horizontal line.
Enumeration HALF_IMAGE
output
outputEvenImage
The output even field image. Image nullptr
output
outputOddImage
The output odd field image. Image nullptr

Object Examples

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

DeinterlaceFrames2d deinterlaceFrames2dAlgo;
deinterlaceFrames2dAlgo.setInputImage( polystyrene );
deinterlaceFrames2dAlgo.setSplitMode( DeinterlaceFrames2d::SplitMode::HALF_IMAGE );
deinterlaceFrames2dAlgo.execute();

std::cout << "outputEvenImage:" << deinterlaceFrames2dAlgo.outputEvenImage()->toString();
std::cout << "outputOddImage:" << deinterlaceFrames2dAlgo.outputOddImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

deinterlace_frames_2d_algo = imagedev.DeinterlaceFrames2d()
deinterlace_frames_2d_algo.input_image = polystyrene
deinterlace_frames_2d_algo.split_mode = imagedev.DeinterlaceFrames2d.HALF_IMAGE
deinterlace_frames_2d_algo.execute()

print( "output_even_image:", str( deinterlace_frames_2d_algo.output_even_image ) )
print( "output_odd_image:", str( deinterlace_frames_2d_algo.output_odd_image ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

DeinterlaceFrames2d deinterlaceFrames2dAlgo = new DeinterlaceFrames2d
{
    inputImage = polystyrene,
    splitMode = DeinterlaceFrames2d.SplitMode.HALF_IMAGE
};
deinterlaceFrames2dAlgo.Execute();

Console.WriteLine( "outputEvenImage:" + deinterlaceFrames2dAlgo.outputEvenImage.ToString() );
Console.WriteLine( "outputOddImage:" + deinterlaceFrames2dAlgo.outputOddImage.ToString() );

Function Examples

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

auto result = deinterlaceFrames2d( polystyrene, DeinterlaceFrames2d::SplitMode::HALF_IMAGE );

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

result_output_even_image, result_output_odd_image = imagedev.deinterlace_frames_2d( polystyrene, imagedev.DeinterlaceFrames2d.HALF_IMAGE )

print( "output_even_image:", str( result_output_even_image ) )
print( "output_odd_image:", str( result_output_odd_image ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

Processing.DeinterlaceFrames2dOutput result = Processing.DeinterlaceFrames2d( polystyrene, DeinterlaceFrames2d.SplitMode.HALF_IMAGE );

Console.WriteLine( "outputEvenImage:" + result.outputEvenImage.ToString() );
Console.WriteLine( "outputOddImage:" + result.outputOddImage.ToString() );