From USB Video Device block
Simulink® Real-Time™ Library for USB Camera
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.
Note: When executed on a single-core target computer, the From USB Video Device block can drop frames if insufficient time is available to process frames received through the USB port. If the block is dropping frames, select a larger frame interval, lengthen the sample time, or use a multicore target computer.
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.
Specify the port to which the webcam is attached. Enter
any USB port.
Enter the width of the image input from the USB port, in pixels.
Enter the height of the image input from the USB port, in pixels.
Select the sample time between frame transfers:
Select whether the incoming frames are to be compressed:
Do not compress frames.
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.
Select the color format for the incoming frames:
Output frames using RGB24 color encoding.
Output frames using YCbCr color encoding.
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: ports R, G, B
YCbCr: ports Y, Cb, Cr
Select this check box to display an input port, Trigger, for the block.
Select this check box to display an output port, Length, for the block.