Main Content

imaqhwinfo

Display information about available image acquisition hardware

    Description

    hwinfo = imaqhwinfo returns information about the image acquisition adaptors available on your system. An adaptor is the interface between MATLAB® and the connected image acquisition devices that uses the image acquisition device driver to facilitate the exchange of information between MATLAB and the device.

    example

    hwinfo = imaqhwinfo(adaptorname) returns information about the specified adaptor. The returned information includes the adaptor version and the available hardware for the adaptor.

    example

    hwinfo = imaqhwinfo(adaptorname,field) returns information in the specified filed for the adaptor. If the field is a cell array, hwinfo is a 1-by-n cell array, where n is the length of field.

    hwinfo = imaqhwinfo(adaptorname,deviceID) returns information about the device specified by the numeric deviceID. If deviceID is a vector, hwinfo is a 1-by-n structure array, where n is the length of deviceID.

    example

    hwinfo = imaqhwinfo(obj) returns information about the specified image acquisition object. The returned information includes the adaptor name, device name, video resolution, native data type, and device driver name and version.

    example

    hwinfo = imaqhwinfo(obj,field) returns the information in the specified field for the image acquisition object.

    Examples

    collapse all

    Information about the adaptors available on the system.

    hwinfo = imaqhwinfo
    
    hwinfo = 
    
      struct with fields:
    
        InstalledAdaptors: {'winvideo'}
            MATLABVersion: '24.2 (R2024b)'
              ToolboxName: 'Image Acquisition Toolbox'
           ToolboxVersion: '24.2 (R2024b)'

    Display information about the devices accessible through a particular adaptor.

     hwinfo = imaqhwinfo('winvideo')
    
    hwinfo = 
    
      struct with fields:
    
           AdaptorDllName: [1x73 char]
        AdaptorDllVersion: '24.2 (R2024b)'
              AdaptorName: 'winvideo'
                DeviceIDs: {[1]}
               DeviceInfo: [1×1 struct]

    This example returns information about a specific device accessible through a particular adaptor. You identify the device by its device ID.

    dev_info = imaqhwinfo('winvideo',1)
    
    dev_info = 
    
              DefaultFormat: 'RGB555_128x96'
        DeviceFileSupported: 0
                 DeviceName: 'IBM PC Camera'
                   DeviceID: 1
      VideoInputConstructor: 'videoinput('winvideo', 1)'
     VideoDeviceConstructor: 'imaq.VideoDevice('winvideo', 1)'       
           SupportedFormats: {1x34 cell}

    Display information about the device associated with a particular video input object.

    obj = videoinput('winvideo', 1);
    obj_info = imaqhwinfo(obj)
    
    obj_info = 
    
                    AdaptorName: 'winvideo'
                     DeviceName: 'IBM PC Camera'
                      MaxHeight: 96
                       MaxWidth: 128
                 NativeDataType: 'uint8'
                   TotalSources: 1
        VendorDriverDescription: 'Windows WDM Compatible Driver'
            VendorDriverVersion: 'DirectX 9.0'

    Input Arguments

    collapse all

    Adaptor name, specified as a character vector or string scalar that specifies the name of the adaptor used to communicate with the device.

    Data Types: char | string

    Image acquisition device ID for the specified adaptor, specified as a nonnegative integer.

    A device ID is a number, assigned by an adaptor, that uniquely identifies an image acquisition device. The adaptor assigns the first device it detects the identifier 1, the second device it detects the identifier 2, and so on.

    Data Types: uint8 | uint16 | uint32 | uint64

    Field name, specified as AdaptorName, AdaptorVersion, DeviceIDs, and DeviceInfo.

    Data Types: char | string

    Image acquisition object, specified as an object. obj includes information such as the name of the adaptor, name of the device, video resolution, and details of the vendor's device driver and version. For more information, see Creating Image Acquisition Objects.

    Output Arguments

    collapse all

    Information about image acquisition adaptor, returned as a structure.

    Tips

    After calling the imaqhwinfo function, the toolbox caches the hardware information. Use imaqreset function to search for new hardware installed while MATLAB is running.

    Version History

    Introduced in R2006a