Documentation

From USB Video Device

From USB Video Device block

Library

Simulink® Real-Time™ Library for USB Camera

Description

The From USB Video Device block enables you to acquire real-time video frames or still images from a USB Video Class (UVC) webcam. You attach the webcam to a USB port on the target computer. After you acquire the image, you can:

  • Display the output on the target computer monitor using a Video Display block.

  • Stream captured frames to the development computer display (for example, using the To Video Display block from Computer Vision System Toolbox™).

  • Analyze the image signals on the development computer.

  • Compress or decompress the input signal with the JPEG Compression or JPEG Decompression blocks.

When you add this block, also add the USB Video Device List block to help configure the webcam.

The Image signal setting determines the Image signal setting for blocks receiving this signal, such as the Video Display block.

Block Parameters

Configuration

Select a configuration that you specified in the USB Video Device List block. When you click the Reload Device List button on the USB Video Device List block, this configuration list is updated.

Port address (-1 for any)

Specify the port to which the webcam is attached. Enter -1 for any USB port.

Image width

Enter the width of the image input from the USB port, in pixels.

Image height

Enter the height of the image input from the USB port, in pixels.

Frame interval

Select the sample time between frame transfers:

  • 1/60

  • 1/30

  • 1/25

  • 1/20

  • 1/15

  • 1/10

  • 1/7.5

  • 1/5

Frame format

Select whether the incoming frames are to be compressed:

  • Uncompressed

    Do not compress frames.

  • MJPEG

    Compress frames using Motion JPEG format. Each frame is individually compressed as a JPEG image. Selecting this option disables the Color format and Image signal parameters.

Color format

Select the color format for the incoming frames:

  • RGB24 (8:8:8)

    Output frames using RGB24 color encoding.

  • YCbCr (4:2:2)

    Output frames using YCbCr color encoding.

Image signal
  • One multidimensional signal

    One signal where each dimension contains color information. Selecting this option creates one port, Image.

  • Separate color signals

    Multiple color signals where each signal contains the information for one color. Selecting this option creates the following ports, depending upon the colorspace.

    • RGB: R, G, B

    • YCbCr: Y, Cb, Cr

Show trigger input

Select this check box to display an input port, Trigger, for the block.

Show length output

Select this check box to display an output port, Length, for the block.

Was this topic helpful?