| Image Acquisition Toolbox | ![]() |
Determining the Dimensions of Image Data
The video format used by the image acquisition device is the primary determinant of the width, height, and the number of bands in each image frame. Image acquisition devices typically support multiple video formats. You select the video format when you create the video input object (described in Specifying the Video Format). The video input object stores the video format in the VideoFormat property.
Industry-standard video formats, such as RS170 or PAL, include specifications of the image frame width and height, referred to as the image resolution. For example, the RS170 standard defines the width and height of the image frame as 640-by-480 pixels. Other devices, such as digital cameras, support the definition of many different, nonstandard image resolutions. The video input object stores the video resolution in the VideoResolution property.
For devices that support the definition of a region of interest (ROI) in the image being captured, the dimensions of the ROI determine the dimensions of the image frames returned. The VideoResolution property specifies the dimensions of the image data being provided by the device; the ROIPosition property specifies the dimensions of the image frames being logged. See the ROIPosition property reference page for more information.
Each image frame is three dimensional; however, the video format determines the number of bands in the third dimension. For color video formats, such as RGB, each image frame has three bands: one each for the red, green, and blue data. Other video formats, such as the grayscale RS170 standard, have only a single band. The video input object stores the size of the third dimension in the NumberOfBands property.
The following example illustrates how video format affects the size of the image frames returned.
imaqhwinfo function to view the list of video formats supported by your image acquisition device. This example shows the video formats supported by a Matrox Orion frame grabber. The formats are industry standard, such as RS170, NTSC, and PAL. These standards define the image resolution.
info = imaqhwinfo('matrox'); info.DeviceInfo.SupportedFormats ans = Columns 1 through 4 'M_RS170' 'M_RS170_VIA_RGB' 'M_CCIR' 'M_CCIR_VIA_RGB' Columns 5 through 8 'M_NTSC' 'M_NTSC_RGB' 'M_NTSC_YC' 'M_PAL' Columns 9 through 10 'M_PAL_RGB' 'M_PAL_YC'
imaqhwinfo function to get the object constructor for your image acquisition device and substitute that syntax for the following code.
getsnapshot function to bring a frame into the workspace.
NumberOfBands property.
start function to start the image acquisition object.
getdata function to bring multiple image frames into the MATLAB workspace.
getdata function brings 10 frames of data into the workspace. Note that the returned data is a four-dimensional array: each frame is three-dimensional and the nth frame is indicated by the fourth dimension.
| Working with Image Data in the MATLAB Workspace | Determining the Data Type of Image Frames | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2010 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |