Contenuto principale

Acquisizione di immagini dalla webcam

Acquisire le immagini dalla webcam

Creare un oggetto webcam, quindi utilizzare la funzione snapshot per acquisire le immagini dalla webcam. È possibile acquisire una singola immagine o impostare un loop per acquisire più immagini. Utilizzare la funzione preview per testare il flusso della fotocamera.

Se la fotocamera consente l'accesso programmatico, è possibile impostare le proprietà specifiche del dispositivo, come la risoluzione e la luminosità. Queste proprietà variano a seconda del dispositivo. Per vedere le proprietà della fotocamera, esaminare l'output quando si crea l'oggetto webcam. Per informazioni sull'impostazione delle proprietà, vedere Set Properties for Webcam Acquisition.

Funzioni

webcamlistList of webcams connected to your system
webcamConnection to a webcam
previewPreview live video data from webcam
snapshotAcquire single image frame from a webcam
closePreviewClose webcam preview window
propertyInfo Retrieve metadata for webcam properties (Da R2024a)

Attività di Live Editor

Acquire Webcam ImageAcquire snapshot from webcam in the Live Editor

Argomenti

  • Webcam Acquisition Overview

    You can use MATLAB® webcam support to bring live images from any USB Video Class (UVC) compliant webcam into MATLAB. Supported platforms are listed here.

  • Acquire Images from Webcams

    To acquire images from a webcam, you first create a webcam object using the webcam function. This example describes the typical workflow for acquiring images from webcams and bringing them into MATLAB.

  • Using Acquire Webcam Image Live Editor Task from Hardware Manager

    You can use MATLAB Hardware Manager to detect your webcam and run the Acquire Webcam Image Live Editor task to interactively connect to your webcam, set its properties based on the live video, and capture images.

  • Acquire Webcam Images in a Loop

    The snapshot function acquires a single image from a webcam. If you want to acquire images in a loop, you can do that with some extra programming.

  • Acquiring a Single Image in a Loop

    This example shows how to use the snapshot function to acquire live images from USB webcams.

  • Logging Video to Disk

    This example shows how to use the snapshot function to acquire live images and log the video to disk.

  • Set Properties for Webcam Acquisition

    You can set object-specific properties for the webcam object to use with any webcam. You can also set device-specific properties for a specific webcam, if supported by your device.

Esempi in primo piano