主要内容

Image From Workspace

Import image fromMATLABworkspace

  • Library:
  • Computer Vision Toolbox / Sources

  • Image From Workspace block

描述

TheImage From Workspaceblock imports an image from a matrix, 3-D array, MATLAB function, or variable stored in theMATLAB®workspace, to the Simulink®workspace.

端口

Output

expand all

Output image, returned as a matrix or 3-D array. If the imported image is binary or grayscale image, the output is a matrix of sizeM-经过-N. If the imported image is a color image, the output is a 3-D array of sizeM-经过-N-by-3。

Dependencies

To enable this port ,set theImage signalparameter toOne multidimensional signal.

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

图像的红色组成部分,返回为M-经过-Nmatrix. The block returns this output if the input is a color image. If theImage signal参数设置为Separate color signals输入图像是二进制图像或灰度,块仅返回此端口

Dependencies

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

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

绿色部分的形象,作为一个返回M-经过-Nmatrix. The block returns this output only if the input is a color image.

Dependencies

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

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

图像的蓝色组成部分,返回为M-经过-Nmatrix. The block returns this output only if the input is a color image.

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

主要的

Specify the image as a vector, matrix, 3-D array, function, or MATLAB workspace variable. The value parameter can be:

  • Vector — The value given to the价值parameter can be a row vector or column vector

  • 3-D numeric array — The value given to the价值参数可以是3-D数组,它是使用MATLAB函数生成的

  • MATLAB工作区变量— The value given to the价值参数可以是变量名称,即Matlab Workspace变量

  • MATLAB函数 - 给出的值价值parameter can be a MATLAB function with specified input arguments to generate a numeric array

此参数指定块执行的示例时间。矢量长度必须为2,代表[周期,偏移]值,其中偏移应小于周期和非负值。给定INF的默认值,该块为灰度和二进制输出矩阵。如果输入图像分别为灰度或颜色图像,则输出为3-D或4-D。

The value of the added dimension is equal to地面((Tsim/Ts)+1)

Tsimis the simulation time andTs是示例时间,用于块执行。例如,如果输入图像为256 by-256矩阵,则模拟时间为10秒,样品时间设置为0.5秒,则输出为256 by-256 by-21阵列。

Specify how the block returns the image read from the MATLAB workspace.

  • One multidimensional signal- 块有一个输出端口,Image,返回整个图像。

  • Separate color signals— The block has an output port for each color channel. Each port returns a single color channel of the image.

Specify labels for the output ports. Each label can be any value. Use the vertical bar character, |, as a delimiter to name all the output ports.

Dependencies

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

数据类型

指定输出图像的数据类型。如果导入图像的数据类型,则在价值参数,不同于输出数据类型parameter, the block scales the pixel values, adds an offset to the pixel values so that they are in the dynamic range of the new data type, or does both. Double- and single-precision floating-point pixel values must be in the range of [0, 1].

如果输入图像数据类型已签名定义点,请选择此参数。

Dependencies

要启用此参数,请设置输出数据类型parameter toFixed-point.

指定定点输出数据类型的单词长度。该值应小于32。

Dependencies

要启用此参数,请设置输出数据类型parameter toFixed-point.

Specify the scaling factor of the fixed-point output by either of the following two methods:

  • Best precision— The output scaling automatically such that the output signal has the best possible precision.

  • User-defined- 输出缩放分数长度parameter.

Dependencies

要启用此参数,请设置输出数据类型parameter toFixed-point.

Specify the number of bits to the right of the decimal point.

Dependencies

要启用此参数,请设置输出数据类型parameter toFixed-point, and set theSet fraction length in outputparameter toUser-defined.

Specify any built-in or fixed-point data type. You can specify fixed-point data types using thefixdt(Simulink)function.

Dependencies

要启用此参数,请设置输出数据类型parameter toUser-defined.

块特征

Data Types

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

Multidimensional Signals

Variable-Size Signals

Extended Capabilities

C/C ++代码生成
Generate C and C++ code using Simulink® Coder™.

Version History

在R2006a之前引入