Start of trail Polar Figure navigation bar

Table of Contents

Display Image

Displays the image in a Matlab figure or on axes within a Matlab GUI.

Library

QUARC Targets/Sinks/Figures

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

qc_open_library('quarc_library/Sinks/Figures')

Description

Display Image

The Display Image block takes a matrix of data that describe the pixels of a color or grayscale image and displays the image in a figure window or on axes within a Matlab GUI. Source images are given as a matrix of values whose dimensions determine the image width and height as well as the image format: color or grayscale. Color images (RGB8) as well as grayscale images (Y8) are supported.

Warning It is recommended that the Display Image block be run with a sample time of 0.1 seconds or slower. Depending on the size of the image, the block may not display the image if the sample time is too fast. Therefore, sample times of 0.1s or slower are recommended. Sample times faster than 0.1 seconds generally aren't necessary for displaying images. For faster video rendering, use the Video Display block instead.

Warning If the error Warning: Not enough memory on the target to process the packet: EXT_SELECT_SIGNALS is displayed in the MATLAB Command window or data on Scopes and the Display Image block are not displayed during model execution, the size of the external mode buffer is too large. The Display Image block acts like a Scope and uploads its signal (the image signal) to the host for display through Simulink's external mode buffers. In order to resolve this issue so that images and data will be displayed the buffer size should be reduced. To reduce the size of the buffer, reduce the number of base rate samples used in the model's external mode buffer by decreasing the Duration in the Signal & Triggering dialog. Open this dialog by selecting the Code/External Mode Control Panel menu item and then clicking on the Signal & Triggering button in the External Mode Control Panel dialog.

Limitations

AppDesigner

Warning The Display Image block may not be used to write images to axes in an AppDesigner GUI because the axes objects in AppDesigner GUIs do not support images. However, it can be used to drive axes in a GUIDE GUI.

Input Ports

A matrix that represents the image to be displayed. The source image should be given in column major order, meaning pixels are listed sequentially column by column rather than row by row. If the source image is color (RGB8), the source matrix should have three dimensions (eg., 480x640x3 for a color image of width 640 pixels and height 480 pixels). If the source image is a grayscale image (Y8), the source matrix should have two dimensions (eg., 480x640 for a grayscale image of width 640 pixels and height 480 pixels).

For a color image, each pixel is represented by three values that describe the red (R), green (G), and blue (B) values for the pixel. Unlike some other image formats, Matlab color images first list all pixels' red values, then green values, then blue values. For example, for a 2x2 color image the pixels will be listed in column major order as follows: [R11 R21 R12 R22 G11 G21 G12 G22 B11 B21 B12 B22], where Rmn represents the red value of the pixel in row m and column n. This data, however, should be shaped as a three-dimensional 2x2x3 matrix so that the Display Image block can detemine the image type and dimensions.

For a grayscale image, each pixel is represented by one value that describes the luminosity of that pixel (0 representing black). The pixels should be organized in column major order and the matrix dimensions must be two.

Output Ports

This block has no output ports.

Data Type Support

The Display Image block supports int8, uint8, int16, uint16, single, double and boolean data types at its input. For floating-point data types, values should range between 0.0 and 1.0. The integral data types use their full range.

Parameters and Dialog Box

Display Image

Figure mode

If the figure mode is "Use figure window" then the plot is rendered in a separate window. In this case, the plot is opened by double-clicking on the block, just like a regular Scope. The properties of the block are accessed by clicking on the Display Image Properties button on the toolbar or by right-clicking on the plot axes and selecting Display Image Properties from the context menu. The help for the block is also accessible from a toolbar button and the context menu.

If the figure mode is "Use axes in GUI" then the plot is rendered on the axes of a preexisting MATLAB GUI. The GUI and axes are identified by the tag name associated with the figure and the axes. For example, a GUI created with GUIDE will have a tag name of 'figure1' and the first axes control placed in the GUI will have a tag name of 'axes1'. In this mode, double-clicking on the block will bring the GUI window forward if it is open, and add a context menu to the plot axes in the GUI. Otherwise it opens the block properties dialog. To access the properties of the block from the axes on the MATLAB GUI, right-click on the plot axes and select Display Image Properties from the context menu. The help for the block is also accessible from this context menu. Note that the context menu is not available until either starting the model or double-clicking on the Display Image block.

Figure tag

This parameter is only visible when the figure mode is "Use axes in GUI". It identifies the MATLAB GUI in which the plot axes are contained by its tag name. The tag name may be changed in GUIDE by clicking on the background of the figure and then opening the Properties window. Scroll down to the "Tag" property in the Properties window. The default tag for figures is "figure1".

Axes tag

This parameter is only visible when the figure mode is "Use axes in GUI". It identifies the axes on which to plot by the tag name of the axes object. The tag name may be changed in GUIDE by clicking on the axes and then opening the Properties window. Scroll down to the "Tag" property in the Properties window. The default tag for the first axes control in the figure is "axes1".

Update rate (samples)

The update rate determines the frequency with which the image is redrawn. The smaller this parameter the more frequently the image is redrawn. The image is redrawn every (update rate * sample time) seconds. Updating the image display faster than 1/10th of a second is generally unnecessary and is not recommended as it compromises the performance of the display.

Sample Time

The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

A sample time of -1 indicates that the block inherits its sample time from the input. The block inherits the sample time by default.

To set the sample time to the fundamental sampling time of the model, use the qc_get_step_size function, which is a QUARC function that returns the fundamental sampling time of the model. The fundamental sampling time of the model is the sampling time entered in the Fixed step size field of the Solver pane of the Configuration parameters.

Show image only

Select this option to display only the image in the figure window, with no tick marks on the axes or labels. The image will fill the entire figure display area, excluding the window caption and borders. The title bar and menu of the figure will be hidden. To access the Display Image parameters, right-click on the block and select Mask Parameters... from the context menu or right-click on the image itself and use its context menu.

Use original image size

Check this option to resize the figure window to match the size of the original image so that no scaling is applied to the image if the Show image only option is also selected.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

In a referenced model the block will behave like a Scope. It compiles successfully but does not appear in the compiled model.

QUARC Win64 Target

Yes

Yes

In a referenced model the block will behave like a Scope. It compiles successfully but does not appear in the compiled model.

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

In a referenced model the block will behave like a Scope. It compiles successfully but does not appear in the compiled model.

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

In a referenced model the block will behave like a Scope. It compiles successfully but does not appear in the compiled model.

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

In a referenced model the block will behave like a Scope. It compiles successfully but does not appear in the compiled model.

Rapid Simulation (RSIM) Target

Yes

Yes

In a referenced model the block will behave like a Scope. It compiles successfully but does not appear in the compiled model.

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

In a referenced model the block will behave like a Scope. It compiles successfully but does not appear in the compiled model.

* Compatible means that the block can be compiled for the target.

See Also

 

navigation bar