Main Content

Connect to Webcams

Use the webcamlist function to return the list of available UVC-compliant webcams connected to your system. The function returns a cell array of camera names. If you plug in different cameras during the MATLAB® session, the webcamlist function returns an updated list of cameras.

If you have a single webcam connected to your system, the output shows one camera:

webcamlist
ans =

  1×1 cell array

    {'Logitech USB Camera'}

If you have multiple webcams connected to your system, the output shows all the cameras in a cell array:

webcamlist
ans =

  2×1 cell array

    {'Dell Camera C250'}
    {'Logitech USB Camera'}

In this case webcamlist detects the built-in webcam in the Dell® computer, and a connected USB webcam.

If you have two cameras connected by USB ports, the output is:

webcamlist
ans =

  2×1 cell array

    {'Dell Camera C250'}
    {'Logitech Webcam Pro 9000'}

Use the name of the camera in the output, for example 'Logitech Webcam 250', to create webcam object for acquiring images.

For more information, see:

Note

In desktop versions of MATLAB, webcam support is available through the MATLAB Support Package for USB Webcams. For instructions, see Install the MATLAB Support Package for USB Webcams. Webcams are also supported in MATLAB Online™. For more information, see Webcam Support in MATLAB Online.

See Also

Related Topics