User`s guide
Previewing Data
2-11
Preview window was designed to only show 8-bit data, but many cameras return 10-, 12-,
14-, or 16-bit data. The Preview window display supports these higher bit-depth cameras.
However, larger bit data is scaled to 8-bit for the purpose of displaying previewed data. If
you need the full resolution of the data, use the getsnapshot or getdata functions.
Opening a Video Preview Window
To open a Video Preview window, use the preview function. The Video Preview window
displays the live video stream from the device. You can only open one preview window
per device. If multiple devices are used, you can open multiple preview windows at the
same time.
The following example creates a video input object and then opens a Video Preview
window for the video input object.
vid = videoinput('winvideo');
preview(vid);
The following figure shows the Video Preview window created by this example. The
Video Preview window displays the live video stream. The size of the preview image
is determined by the value of the video input object's ROIPosition property. The
Video Preview window displays the video data at 100% magnification (one screen pixel
represents one image pixel).
In addition to the preview image, the Video Preview window includes information about
the image, such as the timestamp of the video frame, the video resolution, and the
current status of the video input object.
Note Because video formats typically express resolution as width-by-height, the Video
Preview window expresses the size of the image frame as column-by-row, rather than the
standard MATLAB row-by-column format.