"Camera" (General OS-Supported Camera)

"Camera" provides a general interface for communicating with imaging devices, such as USB webcams, using operating system-supported drivers.

Imaging devices can be built-in or connected via USB, firewire, etc.

Available cameras can be found using $ImagingDevices or FindDevices.

Device Discovery

  • FindDevices["Camera"] lists the camera devices connected to your system.
  • $ImagingDevices gives a list of names of available cameras.

Opening the Device

Configuring the Device

Device Properties

  • The following native properties are available:
  • "DeviceName"Automaticname of the camera
    "FrameRate"Automaticrate at which frames are collected
    "RasterSize"Automaticcamera resolution for capturing frames
    "SupportedCameraResolutions"Automaticimage resolutions supported by the camera
    "Timeout"Automaticidle time until camera is automatically closed
  • The Automatic setting for "FrameRate" is 12 frames per second.
  • Possible values for "RasterSize" are of the form {width,height}.
  • The Automatic setting for "RasterSize" is {320,240}.
  • A connected camera that is left idle for the period specified by the "Timeout" option will be automatically disconnected. The Automatic setting for "Timeout" corresponds to 120 s. "Timeout" can also be set to Infinity.

Reading Data

Closing and Releasing Resources

    DeviceClose[dev]

    stops capture, closes the camera connection, and frees related resources.

Examples

Basic Examples  (6)

Open the default camera using default settings:

Close the device:

Automatically open the default camera using CurrentImage:

Use the Devices function to find the associated DeviceObject:

Close the camera with DeviceClose:

Open the specified camera:

Open the specified camera with parameters:

Change camera settings by setting device properties:

Change camera settings with DeviceConfigure:

Use DeviceRead to capture an image from an opened camera:

Capture a TimeSeries of images: