Acquisition Using Any Hardware
You can acquire images with any type of supported hardware using the
videoinput
object. If you have GigE Vision® or Matrox® hardware, you can continue to use the existing GigE Vision and Matrox adaptors (gige
and
matrox
) with the videoinput
object, or you can use the new interfaces for GigE Vision and Matrox, which provide new objects, gigecam
and
matroxcam
. See Acquisition Using GigE Vision Hardware and Acquisition Using Matrox Hardware for more information on
those interfaces.
In addition to doing the acquisition programmatically using the videoinput
object, you can also acquire images using any type of supported hardware
using the Image Acquisition Explorer, an app that enables you
to set acquisition parameters, preview the image, and acquire images.
For more information on using the app, see Acquisition Using Image Acquisition Explorer.
Note: The functionality for all supported hardware is now available via the Support Package Installer. Starting with R2014a, each adaptor is available separately through the Support Package Installer, and you must install the appropriate support packages to use the toolbox with your hardware. For more information, see Image Acquisition Support Packages for Hardware Adaptors.
Functions
videoinput | Create video input object |
imaq.VideoDevice | Acquire one frame at a time from video device |
getselectedsource | Return currently selected video source object |
chunkDataInfo | View hardware metadata configuration status (Since R2024a) |
commands | List available commands for GigE Vision or GenICam compliant camera |
executeCommand | Execute command on GigE Vision or GenICam compliant camera |
getdata | Acquired image frames to MATLAB workspace |
peekdata | Most recently acquired image data |
getsnapshot | Immediately return single image frame |
set | Configure or display image acquisition object properties |
start | Obtain exclusive use of image acquisition device |
islogging | Determine whether video input object is logging |
isrunning | Determine whether video input object is running |
isvalid | Determine whether image acquisition object is associated with image acquisition device |
wait | Wait until image acquisition object stops running or logging |
stop | Stop video input object |
clear | Clear image acquisition object from MATLAB workspace |
delete | Remove image acquisition object from memory |
flushdata | Remove data from memory buffer used to store acquired image frames |
obj2mfile | Convert video input objects to MATLAB code |
imaqmontage | Sequence of image frames as montage |
load | Load image acquisition object into MATLAB workspace |
save | Save image acquisition objects to MAT-file |
trigger | Initiate data logging |
triggerconfig | Configure video input object trigger properties |
triggerinfo | Provide information about available trigger configurations |
Apps
Image Acquisition Explorer | Acquire images and video from hardware (Since R2022a) |
Topics
Programmatic Workflow
- Acquiring Image Data
Triggers can come from an internal or external event or source. - Controlling Logging Parameters
Describes how you can control various aspects of data logging using toolbox functions and video input object properties. - Logging Image Data to Disk
Log acquired image data from a running video input object to a disk file, to provide a record of your data. - Setting the Values of Trigger Properties
Describes how to set the values of video input object trigger properties. - Specifying the Trigger Type
To specify the type of trigger you want to execute, set the value of theTriggerType
property of the video input object. You can use immediate, manual, or hardware triggering. - Specifying the Color Space
You can determine your device’s default color space and change the color space. - Waiting for an Acquisition to Finish
You can use thewait
function to block the command line until an acquisition completes. - Managing Memory Usage
You can free memory using theflushdata
function.
Using Events and Callbacks When Acquiring Data Programmatically
- Using Events and Callbacks
You can enhance the power and flexibility of your image acquisition application by using event callbacks. - Using the Default Callback Function
Introduces events and callbacks by showing a simple example. - Retrieving Event Information
Describes the information generated with each event and how to access it. - Creating and Executing Callback Functions
Describes how to write a callback function and associate it with an event callback.
Working with Acquired Data Programmatically
- Bringing Image Data into the MATLAB Workspace
You can bring acquired image data into the MATLAB® workspace in multiple ways. - Working with Image Data in MATLAB Workspace
Describes the format of the image data returned to the MATLAB workspace. - Specifying the Color Space
You can determine your device’s default color space and change the color space. - Retrieving Timing Information
You can use thegetdata
function to retrieve timing information, such as when a trigger is executed or when a frame is acquired.
Acquiring Data Using the VideoDevice System Object
- Creating the VideoDevice System Object
You use theimaq.VideoDevice
function to create the System object™. You can specify the adaptor name, device ID, and format when you create the object. - Using VideoDevice System Object to Acquire Frames
The basic workflow for using the VideoDevice System object is to create the object, preview the image, set any properties, acquire a frame, and clear the object. - Using Properties on a VideoDevice System Object
You can specify properties at the time of object creation, or they can be specified and changed after the object is created. - Code Generation with VideoDevice System Object
The VideoDevice System object supports code generation in MATLAB via thecodegen
function.
Image Acquisition Toolbox Overview
- Data Logging
Provides an overview of data logging and a brief description of all the trigger properties supported by the video input object. Acquired frames can be logged in a buffer in memory, a disk file, or both. - Image Acquisition Overview
Provides an overview of data logging and the process of bringing frames into the MATLAB workspace. - Event Types
Defines all the event types supported by the toolbox. - VideoDevice System Object Overview
The VideoDevice System object allows single-frame image acquisition and code generation from MATLAB.