Table of Contents
Video Display
Displays video in a window on the host.
Library
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/Multimedia')Description
The Video Display block displays video in a window on the host. It is designed for typical video frame rates. The video can be paused and resumed, and the current frame may be saved to disk as an image.
This block has much higher performance than the Display Image block because it does not use MATLAB figure windows. However, as a result it cannot be used to drive axes in a MATLAB GUI.
The Video Display block supports both RGB (HxWx3) and grayscale (HxW) inputs. A variety of different input data types are supported that are compatible with The MathWorks'
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
doc vision;The Video Display block also supports variable-size uint8 vector inputs representing a compressed image in JPEG, PNG, BMP, TIFF, GIF and HD Photo (HDP) formats. The HD Photo format is also known as JPEG XR (JXR). The Image Compress block may be used to produce a JPEG image, for example. Since the Video Display block executes on the host rather than the target, the advantage of accepting a compressed image at its input is that network bandwidth is reduced if the maximum size of the variable-sized signal is smaller than the original uncompressed image (which is most often the case). For instance, a 640x480 RGB image displayed at 30 Hz requires 640x480x3 bytes x 8 bits/byte x 30 frames/second = 221 Mbps of network bandwidth! If that image is compressed to a JPEG image that is 20 times smaller then only 11 Mbps of network bandwidth is required.
The Video Display window supports a toolbar and context menu that allow the window to be made full screen or the size of the original video. The video may also be paused and resumed, and the current frame may be saved to disk as an image in a variety of image formats. The toolbar and context menu also allow you to open the block's mask parameters to change its sample time or whether it uses hardware video acceleration.
The toolbar becomes visible whenever the mouse is moved to the bottom half of the video display window. Open the context menu by right-clicking anywhere within the video display window.
This block uses hardware video acceleration by default. If the video is not displaying properly then try updating your video card driver. If that fails then try unchecking the Use hardware acceleration option in the block's mask parameters (use the context menu for the display window to get to the mask parameters). |
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 Video Display block
are not displayed during model execution, the size of the external mode buffer is too large.
The Video Display 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 recommended solution is to either place a Channel
block on the input signal or to use a Video Compressed Display block instead.
The Channel block opens a separate communication channel for the signal so that it becomes independent of
the external mode buffers. Hence, raw video may be displayed without affecting other signals in the model. The Video Compressed Display
block compresses the input prior to sending it to the host, which reduces the memory and bandwidth requirements.
Alternatively, the external mode buffer size may 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 menu item and then
clicking on the button in the External Mode Control Panel dialog. Do
not reduce the Duration
to a value less than 2. Reducing the duration will affect how much data is buffered
on Scopes and other displays however.
Input Ports
image
The input may be an RGB image specified as a three-dimensional MxNx3 matrix where M is the image height and N is the image width. It contains the red, green and blue components for each pixel in the image.
It may also be a grayscale image specified as a two-dimensional MxN matrix. where M is the image height and N is the image width. It contains the luminance for each pixel in the image.
The interpretation of the data depends on the data type. Floating-point types should have elements in the range 0 to 1. Both single and double floating-point types are supported. For integer types, only unsigned integer types are supported. The range of unsigned integer types should be the full range for the integer type.
These inputs are compatible with The MathWorks'
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
doc vision;The input may also be a compressed image specified as a variable-size uint8 vector signal. It contains a compressed JPEG, PNG, BMP, TIFF, GIF or HD Photo (JPEG XR) image. Such an image can be produced using the Image Compress block.
Output Ports
This block has no output ports.
Parameters and Dialog Box
Sample time
The sampling period (in seconds) of the Video Display 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. Since this is a sink block it inherits its sample time by default.
Use hardware acceleration (tunable offline)
Indicates whether to use hardware video acceleration when displaying video. This option is checked by default since better performance is achieved when hardware video acceleration is used.
Not all video cards or drivers support hardware video acceleration. Updating the video card driver however is often all that is required to make hardware acceleration available. Uncheck the Use hardware acceleration option if updating the video card driver does not resolve video display issues. |
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Yes |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.