Input, Output, and Graphics

Computer Vision Toolbox™ provides algorithms and tools for video processing. You can read and write from common video formats and apply common video processing algorithms such as deinterlacing and chroma resampling. You can also display results with text and graphics burned into the video. Adding graphics to video helps you visualize extracted information or debug a system design. You can insert graphics, such as markers, lines, and polygons to mark found features, delineate objects, or highlight other key features.

Video Loading, Saving, and Display

Computer Vision Toolbox provides algorithms and tools for video processing. The Computer Vision Toolbox, together with Image Processing Toolbox™, enables you to view video streams in the loop as you process data, view any video signal within your code or block diagram, and use multiple video viewers at the same time. You can also freeze the display to evaluate the current frame, display pixel information for a region in the frame, and pan, zoom, start, stop, pause and step through simulations one frame at a time. You can:

  • Read, write, and view multimedia files in a range of formats, including AVI and MPEG.

  • Acquire video directly from web cameras, frame grabbers, DCAM-compatible cameras, and other imaging devices using Image Acquisition Toolbox™. When using Simulink®, you can use the MATLAB® workspace as a video source or sink.

NameDescription
vision.BinaryFileReaderRead video data from binary files
vision.BinaryFileWriterWrite binary video data to files
vision.DeployableVideoPlayerDisplay video
vision.VideoPlayerPlay video or display image
vision.VideoFileReaderRead video frames and audio samples from video file
vision.VideoFileWriterWrite video frames and audio samples to video file

Color Space Formatting and Conversions

You can apply common video processing algorithms to images or video, such as deinterlacing, chroma-resampling, and color space formatting and conversions. You can also use color space functionality from the Image Processing Toolbox.

NameDescription
vision.GammaCorrectorApply or remove gamma correction from images or video streams
vision.DemosaicInterpolatorBayer-patttern image conversion to true color
vision.ChromaResamplerDownsample or upsample chrominance components of images

Graphics

Adding graphics to video can help you visualize extracted information or debug a system design. You can also insert text to display the number of objects or to keep track of other key information. You can insert graphics, such as markers, lines, and polygons, to mark found features, delineate objects, or highlight other key features. The toolbox functionality fuses text and graphics into the image or video rather than maintaining a separate layer. You can combine two video sources in a composite that can highlight objects or a key region.

NameDescription
plotCameraPlot a camera in 3-D coordinates
insertMarkerInsert markers in image or video
insertObjectAnnotationAnnotate trucolor or grayscale image or video stream
insertShapeInsert shapes in image or video
insertTextInsert text in image or video
listTrueTypeFontsList available TrueType fonts
bbox2pointsConvert rectangle to corner points list
vision.AlphaBlenderCombine images, overlay images, or highlight selected pixels

Related Examples

More About