Video From Workspace - Import video signal from MATLAB® workspace

Library

Sources

Description

The Video From Workspace block imports a video signal from the MATLAB workspace. If the video signal is a M-by-N-by-T workspace array, the block outputs an intensity video signal, where M and N are the number of rows and columns in a single video frame, and T is the number of frames in the video signal. If the video signal is a M-by-N-by-C-by-T workspace array, the block outputs a color video signal, where M and N are the number of rows and columns in a single video frame, C is the number of color channels, and T is the number of frames in the video stream. In addition to the video signals previously described, this block supports fi objects and variables that are in the structure format returned by the MATLAB aviread function.

PortOutputSupported Data TypesComplex Values Supported

Image

M-by-N matrix of intensity values or an M-by-N-by-P color video signal where P is the number of color planes

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point

  • Boolean

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

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

No

R, G, B

Scalar, vector, or matrix that represents one plane of the RGB video stream. Outputs from the R, G, or B ports have the same dimensions.

Same as I port

No

For the Video and Image Processing Blockset™ blocks to display video data properly, double- and single-precision floating-point pixel values must be from 0 to 1. This block does not scale pixel values.

Use the Signal parameter to specify the MATLAB workspace variable from which to read. For example, to read an AVI file, use the following syntax:

mov = aviread('filename.avi')

The aviread function reads the AVI file into the MATLAB movie structure mov. The MATLAB movie structure might be obsoleted in the future. For more information, see aviread in the MATLAB documentation.

If filename.avi has a colormap associated with it, the AVI file must satisfy the following conditions or the block produces an error:

Use the Sample time parameter to set the sample period of the output signal.

When the block has output all of the available signal samples, it can start again at the beginning of the signal, repeat the final value, or generate 0s until the end of the simulation. The Form output after final value by parameter controls this behavior:

Use the Image signal parameter to specify how the block outputs a color video signal. If you select One multidimensional signal, the block outputs an M-by-N-by-P color video signal, where P is the number of color planes, at one port. If you select Separate color signals, additional ports appear on the block. Each port outputs one M-by-N plane of an RGB video stream.

Use the Output port labels parameter to label your output ports. Use the spacer character, |, as the delimiter. This parameter is available when the Image signal parameter is set to Separate color signals.

Dialog Box

The Video From Workspace dialog box appears as shown in the following figure.

Signal

Specify the MATLAB workspace variable that contains the video signal, or use the aviread function to specify an AVI filename.

Sample time

Enter the sample period of the output.

Form output after final value by

Specify the output of the block after all of the specified signal samples have been generated. The block can output zeros for the duration of the simulation (Setting to zero), repeat the final value (Holding Final Value) or repeat the entire signal from the beginning (Cyclic Repetition).

Image signal

Specify how the block outputs a color video signal. If you select One multidimensional signal, the block outputs an M-by-N-by-P color video signal, where P is the number of color planes, at one port. If you select Separate color signals, additional ports appear on the block. Each port outputs one M-by-N plane of an RGB video stream.

Output port labels

Enter the labels for your output ports using the spacer character, |, as the delimiter. This parameter is available when the Image signal parameter is set to Separate color signals.

See Also

From Multimedia File

Video and Image Processing Blockset

Image From Workspace

Video and Image Processing Blockset

Read Binary File

Video and Image Processing Blockset

To Video Display

Video and Image Processing Blockset

Video Viewer

Video and Image Processing Blockset

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS