Acquire Webcam Image
Description
The Acquire Webcam Image task enables you to interactively connect to a webcam, set properties based on the live video, and capture images. The task automatically generates MATLAB® code for your live script. For more information about Live Editor tasks, see Add Interactive Tasks to a Live Script.
To get started with the Acquire Webcam Image task, select the webcam that is connected to your computer. The task gives you controls that help you set webcam resolution values and other properties:
Image-specific properties — Set the values for webcam brightness, contrast, white balance, and so on.
Device-specific properties — Set the values of webcam backlight compensation, tilt, zoom, and so on.
The default settings of the image and device properties are based on the selected webcam. When you adjust a property, the task updates the corresponding property and captures an image. You can view the property change in real time in the live video preview.
Open the Task
To add the Acquire Webcam Image task to a live script in the MATLAB Editor:
On the Live Editor tab, select Task > Acquire Webcam Image.
In a code block in your script, type a relevant keyword, such as
camera
,webcam
,snapshot
,preview
and so on. SelectAcquire Webcam Image
from the suggested command completions.
Note
You can also use MATLAB Hardware Manager to run Acquire Webcam Image task, see Using Acquire Webcam Image Live Editor Task from Hardware Manager.
Examples
Parameters
Version History
Introduced in R2020b