View videos and image sequences
The Video Viewer app plays movies, videos, or image sequences. The app offers basic video playback aids, including the ability to jump to a specific frame, to adjust the frame rate of the display, and to play in forwards and reverse directions.
Using this app, you can adjust other aspects of the video display and explore video data in more depth.
Get information about frame size, color format, data type, and frame count.
Change the colormap of grayscale and binary image sequences.
Adjust the display range of grayscale image sequences.
Open a Pixel Region tool that displays an extreme close-up view of a small region of pixels in the target image.
Export a frame to the Image Viewer app.
View video signals in Simulink® models (requires Simulink). For more information, see View Video in Simulink (Computer Vision Toolbox).
Video Viewer does not play audio tracks.
Open the Video Viewer App
MATLAB® Toolstrip: On the Apps tab, under Image Processing and Computer Vision, click the Video Viewer app icon.
MATLAB command prompt: Enter
Play Three Types of Videos
Animate a sequence of grayscale images at 10 frames per second.
load cellsequence implay(cellsequence,10)
Visually explore a stack of grayscale MRI images.
load mristack implay(mristack)
Play an AVI file.
implay opens the Video Viewer app in an empty state.
To load a video from a file, select File > Open.
To load an image sequence stored as a variable in the workspace, select File > Import from Workspace.
implay( opens the Video
Viewer app and loads the content of the Audio Video Interleaved (AVI) file
with file name
as a character vector or string scalar. The AVI file determines the default frame
implay( opens the Video
Viewer app and displays the first frame in the multiframe image sequence
I as one of these
An m-by-n-by-k numeric or logical array representing a grayscale or binary image sequence of k frames, respectively.
An m-by-n-by-1-by-k numeric or logical array representing a grayscale or binary image sequence of k frames, respectively.
An m-by-n-by-3-by-k numeric array representing a truecolor (RGB) image sequence of k frames.
A MATLAB movie structure. For more information, see
For numeric data, the preferred data type of
uint8. The actual data type used to display pixels may differ
from the source data type.
The default frame rate is 20 frames per second. To change the frame rate, specify
the second input argument,
implay(___, also specifies
the frame rate
fps in frames per second. Specify
fps as a positive number.
Change Colormap of Grayscale or Binary Image Sequence
Change the colormap of a grayscale or binary image sequence by selecting Tools > Colormap. You cannot change the colormap of a truecolor (RGB) image sequence.
To change the colormap of a grayscale image sequence, select one of the seven
built-in colormaps listed in the table. For a binary image sequence, only the
copper colormaps modify the appearance of the images.
Video Viewer does not support custom colormaps.
|Colormap Name||Color Scale|
Adjust Contrast of Grayscale Image Sequence
Adjust the contrast of a grayscale image sequence by selecting Tools > Colormap. You cannot change the contrast of a binary or truecolor (RGB) image sequence.
Enable contrast adjustment by selecting Specify range of displayed pixel values. The range of values depends on the data type of the image sequence. Specify the new minimum and maximum values of the display range.
Pixel values less than or equal to the minimum display range value display as black, or the first value in the colormap for a nondefault colormap.
Pixel values greater than or equal to the maximum display range value display as white, or the last value in the colormap for a nondefault colormap.
Intermediate pixel values map linearly to the intermediate grayscale values, or the intermediate values in the colormap for a nondefault colormap.
Open Pixel Region Tool to Display Close-Up View
You can open a Pixel Region tool that displays an extreme close-up view of a small
region of pixels in the target image. Access this tool by selecting Tools > Pixel Region. For more information about using the Pixel Region tool, see