Main Content

imaqmontage

Sequence of image frames as montage

Description

imaqmontage(frames) displays a montage of image frames in a MATLAB® figure window using the imagesc function.

imaqmontage(obj) calls the getsnapshot function on video input object obj and displays a single image frame in a MATLAB figure window using the imagesc function.

imaqmontage(...,CLIM) displays a montage of image frames. Use CLIM to specify a scaling value when overscaling the image data is a risk, for example, when you are working with devices that provide data in a 12-bit format.

imaqmontage(...,'CLim',CLIM,'Parent',PARENT) where CLIM is as noted previously, and PARENT is a valid AXES object that allows you to specify where the montage is displayed. One or both property/value pairs can be specified.

example

h = imaqmontage(...) returns a handle to the image object containing the montage.

Examples

collapse all

Construct a video input object. Use your own adaptorname, deviceID and format when executing the command. To check the available adaptors and devices on your system, you can optionally use the imaqhwinfo function first.

imaqhwinfo
ans = struct with fields:
    InstalledAdaptors: {'demo'  'gentl'  'gige'  'kinect'  'matrox'  'winvideo'}
        MATLABVersion: '25.1 (R2025a)'
          ToolboxName: 'Image Acquisition Toolbox'
       ToolboxVersion: '25.1 (R2025a)'

vidobj = videoinput('winvideo', 2, 'RGB24_800X600');

Initiate an acquisition and access the logged data.

start(vidobj);
data = getdata(vidobj);

Create an axes object.

a = axes;

Display each image frame acquired on axes a.

imaqmontage(data, 'Parent', a)

Figure contains an axes object. The axes object contains an object of type image.

Remove the video input object from memory.

delete(vidobj);

Input Arguments

collapse all

Image data, specified as an H-by-W-by-B or H-by-W-by-B-by-F array, where:

H

Image height, as specified in the object's ROIPosition property

W

Image width, as specified in the object's ROIPosition property

B

Number of color bands, as specified in the NumberOfBands property

F

Number of frames returned

frames can be any data set returned by getdata, peekdata, or getsnapshot.

Video input object, specified as a 1-by-1 video input object. You can use the videoinput function to create a video input object. imaqmontage calls the getsnapshot function on the video input object obj, and displays a single image frame in a MATLAB figure window using the imagesc function.

Example: videoinput("matrox")

Image color limits, specified as a two-element vector of the form [CLOW CHIGH], where CHIGH is greater than CLOW. Use CLIM to specify color limits when overscaling the image data is a risk, for example, when you are working with devices that provide data in a 12-bit format.

Axes object, on which the montage is displayed.

Output Arguments

collapse all

Image object containing the montage, returned as an image object handle. Use h to set properties of the montage image after it is created.

Version History

Introduced before R2006a