Contents

Deinterlacing

Remove motion artifacts by deinterlacing input video signal

Library

Analysis & Enhancement

visionanalysis

Description

The Deinterlacing block takes the input signal, which is the combination of the top and bottom fields of the interlaced video, and converts it into deinterlaced video using line repetition, linear interpolation, or vertical temporal median filtering.

    Note:   This block supports intensity and color images on its ports.

PortInput/OutputSupported Data TypesComplex Values Supported

Input

Combination of top and bottom fields of interlaced video

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point

  • 8-, 16-, and 32-bit signed integer

  • 8-, 16-, and 32-bit unsigned integer

No

Output

Frames of deinterlaced video

Same as Input port

No

Use the Deinterlacing method parameter to specify how the block deinterlaces the video.

The following figure illustrates the block's behavior if you select Line repetition.

The following figure illustrates the block's behavior if you select Linear interpolation.

The following figure illustrates the block's behavior if you select Vertical temporal median filtering.

Row-Major Data Format

The MATLAB® enviroment and the Computer Vision System Toolbox™ software use column-major data organization. However, the Deinterlacing block gives you the option to process data that is stored in row-major format. When you select the Input image is transposed (data order is row major) check box, the block assumes that the input buffer contains contiguous data elements from the first row first, then data elements from the second row second, and so on through the last row. Use this functionality only when you meet all the following criteria:

  • You are developing algorithms to run on an embedded target that uses the row-major format.

  • You want to limit the additional processing required to take the transpose of signals at the interfaces of the row-major and column-major systems.

When you use the row-major functionality, you must consider the following issues:

  • When you select this check box, the first two signal dimensions of the Deinterlacing block's input are swapped.

  • All the Computer Vision System Toolbox blocks can be used to process data that is in the row-major format, but you need to know the image dimensions when you develop your algorithms.

    For example, if you use the 2-D FIR Filter block, you need to verify that your filter coefficients are transposed. If you are using the Rotate block, you need to use negative rotation angles, etc.

  • Only three blocks have the Input image is transposed (data order is row major) check box. They are the Chroma Resampling, Deinterlacing, and Insert Text blocks. You need to select this check box to enable row-major functionality in these blocks. All other blocks must be properly configured to process data in row-major format.

Use the following two-step workflow to develop algorithms in row-major format to run on an embedded target.

See the DM642 EVM Video ADC and DM642 EVM Video DAC reference pages.

Example

The following example shows you how to use the Deinterlacing block to remove motion artifacts from an image.

  1. Open the example model by typing

    ex_deinterlaceex_deinterlace

    at the MATLAB command prompt.

  2. Double-click the Deinterlacing block. The model uses this block to remove the motion artifacts from the input image. The Deinterlacing method parameter is set to Vertical temporal median filtering.

  3. Run the model.

    The original image that contains the motion artifacts appears in the Input Image window.

    The clearer output image appears in the Output Image window.

Fixed-Point Data Types

The following diagram shows the data types used in the Deinterlacing block for fixed-point signals.

You can set the product output, accumulator, and output data types in the block mask as discussed in the next section.

Dialog Box

The Main pane of the Deinterlacing dialog box appears as shown in the following figure.

Deinterlacing method

Specify how the block deinterlaces the video. Your choices are Line repetition, Linear interpolation, or Vertical temporal median filtering.

Input image is transposed (data order is row major)

When you select this check box, the block assumes that the input buffer contains data elements from the first row first, then data elements from the second row second, and so on through the last row.

The Data Types pane of the Deinterlacing dialog box appears as shown in the following figure.

    Note:   The parameters on the Data Types pane are only available if, for the Deinterlacing method, you select Linear interpolation.

Rounding mode

Select the rounding mode for fixed-point operations.

Overflow mode

Select the overflow mode for fixed-point operations.

Accumulator

As depicted in the previous figure, inputs to the accumulator are cast to the accumulator data type. The output of the adder remains in the accumulator data type as each element of the input is added to it. Use this parameter to specify how to designate this accumulator word and fraction lengths:

  • When you select Same as product output, these characteristics match those of the product output.

  • When you select Same as input, these characteristics match those of the input.

  • When you select Binary point scaling, you can enter the word length and the fraction length of the accumulator, in bits.

  • When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the accumulator. The bias of all signals in the Computer Vision System Toolbox blocks is 0.

Output

Choose how to specify the output word length and fraction length:

  • When you select Same as input, these characteristics match those of the input to the block.

  • When you select Binary point scaling, you can enter the word length and the fraction length of the output, in bits.

  • When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the output. This block requires power-of-two slope and a bias of 0.

Lock data type settings against change by the fixed-point tools

Select this parameter to prevent the fixed-point tools from overriding the data types you specify on the block mask. For more information, see fxptdlg, a reference page on the Fixed-Point Tool in the Simulink® documentation.

Was this topic helpful?