Image From Workspace

Import image from MATLAB workspace

Library

Sources

visionsources

Description

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.

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 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.

Parameters

Value

Specify the MATLAB workspace variable that you want to import into Simulink environment.

Sample time

Enter the sample period of the output signal.

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 visible if you set the Image signal parameter to Separate color signals.

Output data type

Specify the data type of your output signal.

Signed

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.

Word length

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.

Set fraction length in output to

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.

Fraction length

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.

User-defined data type

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.

See Also

From Multimedia File

Computer Vision Toolbox software

To Video Display

Computer Vision Toolbox software

Video From Workspace

Computer Vision Toolbox software

Video Viewer

Computer Vision Toolbox software

im2double

Image Processing Toolbox™ software

im2uint8

Image Processing Toolbox software

Extended Capabilities

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

Introduced before R2006a