Supported Functions for Webcam

You can use these functions with the MATLAB® webcam feature.

FunctionPurpose
webcamlistReturns list of webcams that are connected to your system.

webcamlist

webcamCreates webcam object and connects to the single camera on your system. If you have multiple cameras and you use the webcam function with no input argument, it creates the object and connects it to the first camera it finds.

cam = webcam

For information on how to create the object with an input argument if you have multiple cameras connected, see Create a Webcam Object.

previewPreview the images from the webcam. Use name of object as input argument, which is cam in this example.

preview(cam)
snapshotAcquire a single image from the webcam. Use name of object as input argument, which is cam in this example.

img = snapshot(cam);

closePreviewClose the preview window.

closePreview(cam)

See Also

| | | |

Related Topics