웹캠 이미지 수집
webcam
객체를 만든 다음 snapshot
함수를 사용하여 웹캠에서 이미지를 수집합니다. 하나의 이미지를 수집하거나, 루프를 설정하여 복수의 이미지를 수집할 수 있습니다. 카메라 스트림을 테스트하려면 preview
함수를 사용하십시오.
카메라에서 프로그래밍 방식 액세스를 허용하는 경우 해상도, 밝기와 같은 장치 관련 속성을 설정할 수 있습니다. 이러한 속성은 장치에 따라 따릅니다. 카메라의 속성을 보려면 webcam
객체를 만들 때 출력값을 확인하십시오. 속성을 설정하는 방법에 대한 자세한 내용은 Set Properties for Webcam Acquisition 항목을 참조하십시오.
함수
webcamlist | List of webcams connected to your system |
webcam | Connection to a webcam |
preview | Preview live video data from webcam |
snapshot | Acquire single image frame from a webcam |
closePreview | Close webcam preview window |
propertyInfo | Retrieve metadata for webcam properties (R2024a 이후) |
라이브 편집기 작업
웹캠 이미지 수집 | Acquire snapshot from webcam in the Live Editor (R2020b 이후) |
도움말 항목
- 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.