| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Video and Image Processing Blockset |
| Contents | Index |
| Learn more about Video and Image Processing Blockset |
Sources

Use the Image From File block to import an image from a supported image file. For a list of supported file formats, see the imread function reference page in the MATLAB documentation. If the image is a M-by-N 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 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 |
| Yes |
R, G, B | Scalar, vector, or matrix that represents one plane of the input RGB video stream. Outputs from the R, G, or B ports have the same dimensions. | Same as I port | Yes |
For the Video and Image Processing Blockset 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 File name parameter to specify the name of the graphics file that contains the image to import into the Simulink modeling and simulation software. If the file is not on the MATLAB path, use the Browse button to locate the file. This parameter supports URL paths.
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.
The Main pane of the Image From File dialog box appears as shown in the following figure.

Specify the name of the graphics file that contains the image to import into the 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.
The Data Types pane of the Image From File dialog box appears as shown in the following figure.

Specify the data type of your output signal.
Select to output a signed fixed-point signal. Otherwise, the signal will be 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 Simulink Fixed Point library. This parameter is only visible when you select User-defined for the Output data type parameter.
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Image Processing Toolbox software | |
Image Processing Toolbox software | |
MATLAB |
![]() | Image Data Type Conversion | Image From Workspace | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |