Video From Workspace
Import video signal fromMATLABworkspace
Library
Sources
visionsources
![](http://www.tianjin-qmedu.com/help/releases/R2018a/vision/ref/video_from_workspace_block.png)
Description
TheVideo From Workspaceblock 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.
Note
If you generate code from a model that contains this block,万博1manbetx®Coder™takes a long time to compile the code because it puts all of the video data into the.c
file. Before you generate code, you should convert your video data to a format supported by the From Multimedia File block or the Read Binary File block.
Port | Output | Supported Data Types | Complex 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 |
|
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 Computer Vision System Toolbox™ 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 theSignalparameter to specify the MATLAB workspace variable from which to read. For example, to read an AVI file, use the following syntax:
mov = VideoReader('filename.avi')
Iffilename.avi
has a colormap associated with it, the AVI file must satisfy the following conditions or the block produces an error:
The colormap must be empty or have 256 values.
The data must represent an intensity image.
The data type of the image values must be
uint8
.
Use theSample timeparameter 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. TheForm output after final value byparameter controls this behavior:
When you specify
Setting To Zero
, the block generates zero-valued outputs for the duration of the simulation after generating the last frame of the signal.When you specify
Holding Final Value
, the block repeats the final frame for the duration of the simulation after generating the last frame of the signal.When you specify
Cyclic Repetition
, the block repeats the signal from the beginning after it reaches the last frame in the signal.
Use theImage signalparameter to specify how the block outputs a color video signal. If you selectOne 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 selectSeparate color signals
, additional ports appear on the block. Each port outputs one M-by-N plane of an RGB video stream.
Use theOutput port labelsparameter to label your output ports. Use the spacer character, |, as the delimiter. This parameter is available when theImage signalparameter is set toSeparate color signals
.
Parameters
- Signal
-
Specify the MATLAB workspace variable that contains the video signal, or use the
VideoReader
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 selectSeparate 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 theImage signalparameter is set to
Separate color signals
.
See Also
Computer Vision System Toolbox software |
|
Computer Vision System Toolbox software |
|
Computer Vision System Toolbox software |
|
Computer Vision System Toolbox software |
|
Computer Vision System Toolbox software |