Remove motion artifacts by deinterlacing input video signal
Analysis & Enhancement
visionanalysis
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.
This block supports intensity and color images on its ports.
Port | Input/Output | Supported Data Types | Complex Values Supported |
---|---|---|---|
Input | Combination of top and bottom fields of interlaced video |
| 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
.
The MATLAB® environment and the Computer Vision 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 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.
The following example shows you how to use the Deinterlacing block to remove motion artifacts from an image.
Open the example model by typing
at the MATLAB command prompt.
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
.
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.
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.
Specify how the block deinterlaces the video. Your choices are Line
repetition
, Linear interpolation
,
or Vertical temporal median filtering
.
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 parameters on the Data Types pane
are only available if, for the Deinterlacing method,
you select Linear interpolation
.
Select the rounding mode for fixed-point operations.
Select the overflow mode for fixed-point operations.
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 Toolbox blocks is 0.
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.
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.