Import image from MATLAB workspace
Sources
visionsources
Use the Image From Workspace block to import an image from the MATLAB® workspace. If the image is a M-by-N workspace array, the block outputs a binary or intensity image, where M and N are the number of rows and columns in the image. If the image is a M-by-N-by-P workspace array, the block outputs a color image, where M and N are the number of rows and columns in each color plane, P.
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 Toolbox™ blocks to display video data properly, double- and single-precision floating-point pixel values must be between 0 and 1. If the input pixel values have a different data type than the one you select using the Output data type parameter, the block scales the pixel values, adds an offset to the pixel values so that they are within the dynamic range of their new data type, or both.
Use the Value parameter to specify the MATLAB workspace variable that contains the image you want to import into Simulink® environment.
Use the Sample time parameter to set the sample period of the output signal.
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 visible if you set the
Image signal parameter to Separate color
signals
.
On the Data Types pane, use the Output data type parameter to specify the data type of your output signal.
Specify the MATLAB workspace variable that you want to import into Simulink environment.
Enter the sample period of the output 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.
Enter the labels for your output ports using the spacer character, |, as
the delimiter. This parameter is visible if you set the Image
signal parameter to Separate color
signals
.
Specify the data type of your output signal.
Select to output a signed fixed-point signal. Otherwise, the signal is
unsigned. This parameter is only visible if, from the Output
data type list, you select
Fixed-point
.
Specify the word length, in bits, of the fixed-point output data type.
This parameter is only visible if, from the Output data type
list, you select
Fixed-point
.
Specify the scaling of the fixed-point output by either of the following two methods:
Choose Best precision
to have the
output scaling automatically set such that the output signal has the
best possible precision.
Choose User-defined
to specify the
output scaling in the Fraction length
parameter.
This parameter is only visible if, from the Output data type list,
you select Fixed-point
or when you select
User-defined
.
For fixed-point output data types, specify the number of fractional bits,
or bits to the right of the binary point. This parameter is only visible
when you select Fixed-point
or
User-defined
for the Output data
type parameter and User-defined
for the Set fraction length in output to
parameter.
Specify any built-in or fixed-point data type. You can specify fixed-point
data types using the sfix
, ufix
,
sint
, uint
,
sfrac
, and ufrac
functions
from the Fixed-Point
Designer™ library. This parameter is only visible when you select
User-defined
for the Output data
type parameter.
Computer Vision Toolbox software | |
Computer Vision Toolbox software | |
Computer Vision Toolbox software | |
Computer Vision Toolbox software | |
Image Processing Toolbox™ software | |
Image Processing Toolbox software |