Video Viewer - Display binary, intensity, or RGB images or video streams
Library
Sinks
Description

The Video Viewer block enables you to view a binary, intensity,
or RGB image or a video stream. The block provides simulation controls
for play, pause, and step while running the model. The block also
provides pixel region analysis tools. During code generation, Real-Time Workshop software
does not generate code for this block.
See the following table for descriptions of both input types.
| Input | Description |
| 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. |
| R/G/B | Scalar, vector, or matrix that represents one plane of the
RGB video stream. Inputs to the R, G, or B ports must have the same
dimensions and data type. |
Select File > Image Signal to set the
input to either Image or RGB.
Dialogs

Toolbar
Playback Toolbar
Setting Viewer Configuration
The Video Viewer Configuration preferences enables you to change
the behavior and appearance of the graphic user interface (GUI) as
well as the behavior of the playback shortcut keys.
To open the Configuration dialog box, select File > Configuration Set > Edit.
To save the configuration settings for future use,
select File > Configuration
Set > Save as.
Core Pane
The Core pane in the Viewer Configuration dialog box controls
the GUI's general settings.

General UI
Click General
UI, and click the Options button
to open the General UI Options dialog box.

If you select the Display
the full source path in the title bar check box, the GUI
displays the model name and full Simulink path to the video data
source in the title bar. Otherwise, it displays a shortened name.
Use the Open message log: parameter to
control when the Message log window opens. You can use this window
to debug issues with video playback. Your choices are for
any new messages, for warn/fail messages, only
for fail messages, or manually.
Tools Pane
The Tools pane in the Viewer Configuration dialog box contains
the tools that appear on the Video Viewer GUI. Select the Enabled check
box next to the tool name to specify which tools to include on the
GUI.

Image Tool
Click Image Tool, and then
click the Options button to open the Image
Tool Options dialog box.

Select the Open new Image Tool window for
export check box if you want to send each video frame to
a different session of Image Tool.
Pixel Region
Select
the Pixel Region check box to display and enable
the pixel region GUI button. For more information on working with
pixel regions see Getting Information
about the Pixels in an Image.
Image Navigation Tools
Select
the Image Navigation Tools check box to enable
the pan-and-zoom GUI button.
Instrumentation Set
Select
the Instrumentation Set check box to enable the
option to load and save viewer settings. The option appears in the File menu.
Video Information
The Video Information dialog box lets you view basic information
about the video. To open this dialog box, you can select Tools
> Video Information , click the information button
, or press
the V key.

Colormap for Intensity Video
The Colormap dialog box lets you change the colormap of an intensity
video. You cannot access the parameters on this dialog box when the
GUI displays an RGB video signal. To open this dialog box for an intensity
signal, select Tools > Colormap or press C.

Use the Colormap parameter to specify the
colormap to apply to the intensity video.
If you know that the pixel values do not use the entire data
type range, you can select the Specify range of displayed
pixel values check box and enter the range for your data.
The dialog box automatically displays the range based on the data
type of the pixel values.
Status Bar
A status bar appear along the bottom of the Video Viewer. It
displays information pertaining to the video status (running, paused
or ready), type of video (Intensity or RGB) and video time.
Message Log
The Message Log dialog provides a system level record of configurations
and extensions used. You can filter what messages to display by Type and Category,
view the records, and display record details.
The Type parameter allows you to select
either All, Info, Warn, or Fail message
logs. The Category parameter allows you to select
either Configuration or Extension message
summaries. The Configuration messages indicate
when a new configuration file is loaded. The Extension messages
indicate a component is registered. For example, you might see a Simulink message,
which indicates the component is registered and available for configuration.
Saving the Settings of Multiple Video Viewer GUIs
The Video Viewer GUI enables you to save and load the settings
of multiple GUI instances. Thus, you only need to configure the Video
Viewer GUIs that are associated with your model once. To save the
GUI settings, select File > Instrumentation Sets > Save Set. To open the preconfigured GUIs, select File > Instrumentation Sets > Load Set.
Supported Data Types
| Port | Supported Data Types |
| Image | Double-precision floating point Single-precision floating point Boolean 8-, 16-, and 32-bit signed integer 8-, 16-, and 32-bit unsigned integer
|
| R/G/B | Same as Image port |
See Also
| From Multimedia File | Video and Image Processing Blockset software |
| mplay | Video and Image Processing Blockset software |
| To Multimedia File | Signal Processing Blockset software |
| To Video Display | Video and Image Processing Blockset software |
| Video To Workspace | Video and Image Processing Blockset software |
| implay | Image Processing Toolbox |
 | Video To Workspace | | Write AVI File (Obsolete) |  |
Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
Get this Simulink Kit