主要内容

Video From Workspace

导入视频MATLABworkspace

  • Library:
  • Computer Vision Toolbox / Sources

  • Video From Workspace

Description

TheVideo From Workspaceblock imports a video from the MATLAB®工作区。块的输出取决于工作区中视频的格式。

  • If the video is represented by anM-经过-N-经过-T大批, the block outputs a grayscale video.MN是每个视频帧中的行和列数,和T是视频中的帧数。

  • If the video is represented by anM-经过-N-经过-C-经过-T数组,块输出公司lor video.MN是每个视频帧中的行和列数,Cis the number of color channels, andT是视频中的帧数。

Note

  • If you generate code from a model that contains this block, it takes long to compile the code as the金宝app®Coder™puts all of the video data into the。C文件。要缩短代码生成时间,将视频数据转换为支持的格式金宝app从Multimedia File或者Read Binary Fileblock.

  • TheVideo From Workspaceblock also supportsfiobjects. For more information onfi对象,参见fi对象属性(定点设计师).

港口

Output

expand all

Output image or video, returned as anM-经过-N-经过-T阵列或M-经过-N-经过-C-经过-T大批. If the output is a 3-D array, the third dimension is the number of frames in the video. If the output is a 4-D array, the third dimension is the number of color channels, and the fourth dimension is the number of frames in the video.

Note

If an RGB image of size,M-经过-N-经过-3 array is imported from the MATLAB workspace, the block considers the third dimension to be the number of frames and processes the image as a grayscale video with 3 identical frames.

Data Types:single|double|int8|INT16|INT32.|uint8|uint16|uint32|Boolean|固定点

Red color component of the input video, returned as a 3-D array. The third dimension is the number of frames in the input video.

Note

The port label can be changed by using theOutput port labels范围。

Dependencies

To enable this port, set theImage signalparameter toSeparate color signals.

Data Types:single|double|int8|INT16|INT32.|uint8|uint16|uint32|Boolean|固定点

输入视频的绿色组件,返回为3-D阵列。第三维度是输入视频中的帧数。

Note

The port label can be changed by using theOutput port labels范围。

Dependencies

To enable this port, set theImage signalparameter toSeparate color signals.

Data Types:single|double|int8|INT16|INT32.|uint8|uint16|uint32|Boolean|固定点

Blue color component of the input video, returned as a 3-D array. The third dimension is the number of frames in the input video.

Note

The port label can be changed by using theOutput port labels范围。

Dependencies

To enable this port, set theImage signalparameter toSeparate color signals.

Data Types:single|double|int8|INT16|INT32.|uint8|uint16|uint32|Boolean|固定点

Parameters

expand all

指定从工作区读取的视频。此参数的值可以是3-D数字阵列,4-D数字数组或MATLAB工作空间变量。

To import an AVI file from the MATLAB workspace, use this process.

  1. Read the file by using the录像机function.

    mov = VideoReader('filename.avi')
  2. 在这种情况下指定工作区变量mov作为价值Signal范围。如果AVI文件具有相关的ColorMap,则必须满足这些条件。

    • The colormap must be empty or have 256 values.

    • The data must represent a grayscale image.

    • The data type of the pixel values must beuint8.

This parameter specifies the sample period of the output video as a positive scalar or-1. When set to-1, the block inherits the sample time from the simulink model.

Specify the block output for the duration of the simulation after the block generates the final video frame.

  • Setting to zero— Generate zero-valued outputs.

  • Holding final value— Repeat the final frame.

  • Cyclic repetition— Repeat the video from the beginning.

指定块返回彩色视频的格式。

  • One multidimensional signal- 以单个4-D阵列返回视频的所有颜色通道。第三维是视频中的颜色通道的数量。

  • Separate color signals- 将视频的每个颜色通道作为单独的3-D阵列返回。此设置启用块上的多个输出端口等于视频中的颜色通道数。每个端口都返回一个颜色通道。

为输出端口命名。使用垂直条形字符|,作为分隔符。

例子:: Red|Green|Blue

Dependencies

要启用此参数,请设置Image signalparameter toSeparate color signals.

块特征

Data Types

Boolean|double|固定点|整数|single

Multidimensional Signals

yes

Variable-Size Signals

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

在R2006A之前介绍