Main Content

Video Viewer

Display images or video frames

  • Library:
  • Computer Vision Toolbox / Sinks

  • Video Viewer block

Description

TheVideo Viewerblock displays images or video frames. This block provides simulation controls to play, pause, and step while streaming a video or image sequence. This block also provides tools to analyze the pixels of a region of interest.

Video Viewer Window

Features of Video Viewer

  • Playback control — Control video playback using the Run, Step Forward, and Stop buttons.

  • Export toImage Viewer— To open the displayed image in a separate window using theImage Viewerapp, selectFile>Export to Image Tool. Alternatively, select the Export to Image Tool button in the toolbar. For more information, seeGet Started with Image Viewer App.

  • Pixel region analysis— To open the displayed image in a separate window using the Pixel Region tool, selectTools>Pixel Region. Alternatively, select the Inspect pixel values button in the toolbar. For more information about Pixel Region tool, seeimpixelregion.

Ports

Input

expand all

Input image or video, specified as anM-by-Nmatrix,M-by-N-by-Tarray, orM-by-N-by-C-by-Tarray.Tis the number of frames in a video or image sequence, andCis the number of color channels.

Dependencies

To enable this port, select theOne Multi-Dimensional Signalparameter. This parameter is enabled by default.

Data Types:single|double|int8|int16|int32|uint8|uint16|uint32|Boolean|Simulink.ImageType

Red color component of the image or video, specified as anM-by-Nmatrix orM-by-N-by-Tarray.Tis the number of frames in a video or image sequence.

Note

Inputs to theR,G, andBports must all have the same dimensions and data type.

Dependencies

To enable this port, select theSeparate Color Signalsparameter.

Data Types:single|double|int8|int16|int32|uint8|uint16|uint32|Boolean

绿色分量图像的or video, specified as anM-by-Nmatrix orM-by-N-by-Tarray.Tis the number of frames in a video or image sequence.

Note

Inputs to theR,G, andBports must all have the same dimensions and data type.

Dependencies

To enable this port, select theSeparate Color Signalsparameter.

Data Types:single|double|int8|int16|int32|uint8|uint16|uint32|Boolean

Blue color component of the image or video, specified as anM-by-Nmatrix orM-by-N-by-Tarray.Tis the number of frames in a video or image sequence.

Note

Inputs to theR,G, andBports must all have the same dimensions and data type.

Dependencies

To enable this port, select theSeparate Color Signalsparameter.

Data Types:single|double|int8|int16|int32|uint8|uint16|uint32|Boolean

Parameters

expand all

File

To access these parameters, select theFilemenu in the Video Viewer window

Select this parameter to automatically open the Video Viewer window at the start of the simulation. Clear this parameter to prevent the Video Viewer window from opening at the start of the simulation.

Select this parameter to enable theR,G, andBinput ports for separate color channels. If you select this parameter, theOne Multi-Dimensional Signalparameter clears automatically.

Select this parameter to enable theImageinput port for one multi-dimensional signal. If you select this parameter, theSeparate Color Signalsparameter clears automatically.

File > Configuration > Edit > Core

The Video Viewer配置parameters enable you to change the behavior and appearance of the graphic user interface (GUI).

  • To open the Configuration dialog box and edit parameters, selectFile>配置>Edit.

TheCoretab in the Configuration dialog box lists the general settings of the GUI.

  • In theCoretab, selectGeneral UIitem and click thePropertiesbutton to open the General UI Properties dialog box.

Select this parameter to display the model name and full path to the source data in the title bar of the Video Viewer window. If you clear this parameter, the window displays a shortened name.

File > Configuration > Edit > Tools

The Video Viewer配置parameters enable you to change the behavior and appearance of the graphic user interface (GUI).

  • To open the Configuration dialog box and edit parameters, selectFile>配置>Edit.

TheToolstab in the Configuration dialog box lists the tools associated with the Video Viewer block.

  • In theToolstab, select theImage Toolitem and click thePropertiesbutton to open the Image Tool Properties dialog box.

Select this parameter to open a newImage Viewerwindow for each exported video frame or image in an image sequence..

Tools > Colormap

TheColormapparameters enable you to display an intensity image in various colormap formats and control the output intensity range. To access these parameters, selectTools>Colormapor pressC.

Note

TheColormapparameters are available for intensity images only.

This parameter specifies the colormap in which to display the input intensity image. This block supports thegray(256),parula(256),jet(256),hot(256),bone(256), andcopper(256)colormaps.

Select this parameter to enable theMinandMaxparameters, through which you can specify the display range of pixel intensities.

If a pixel has an intensity value less than or equal to the value of this parameter,Video Viewerdisplays it as the first color in the selected colormap.

Note

When specifying a value forMin, remember that the data type of the input image or video determines the range of intensity values representing that image or video.

Dependencies

To enable this parameter, select theSpecify range of displayed pixel values [-Inf to Inf]parameter.

If a pixel has an intensity value higher than or equal to the value of this parameter,Video Viewerdisplays it as the last color in the selected colormap.

Note

When specifying a value forMax, remember that the data type of the input image or video determines the range of intensity values representing that image or video.

Dependencies

To enable this parameter, select theSpecify range of displayed pixel values [-Inf to Inf]parameter.

Simulation

To access this parameter, select theSimulationmenu in the Video Viewer window.

Select this parameter to reduce the frame rate of the input video signal to improve performance of the simulation. If you unselect this parameter, the block displays all the frames in the input video signal during simulation.

Block Characteristics

Data Types

Boolean|double|integer|single

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

yes

Zero-Crossing Detection

no

Version History

Introduced before R2006a