Table of Contents
Vision Capture Image
This block is currently a beta version. If you are using this block, we would appreciate any feedback at tech@quanser.com. |
Captures images from a USB camera.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library_beta/Image Processing/Open Source Computer Vision')Description
The Vision Capture Image block initializes the USB camera attached to the target and grabs images at the specified sampling rate. Note that the Vision blocks use OpenCV to implement the vision algorithms. OpenCV is subject to the following license agreement.
The Vision blocks are currently only supported on the linux_verdex and linux_overo targets. Furthermore, a model containing a Vision block may only be built using the CodeSourcery Lite cross-compiler on the host PC. Use of the CodeSourcery Lite cross-compiler results in much faster compilations, but requires that the CodeSourcery Lite cross-compiler be installed. Refer to Installing CodeSourcery for details on how to install this freely available compiler.
The default compiler when building for the gumstix targets is an LLVM-GCC based cross-compiler. To change the compiler to use CodeSourcery Lite, open the Configuration Parameters dialog by selecting Code Generation/QUARC item in the treeview. Choose either the LLVM-GCC based on CodeSourcery Lite or CodeSourcery Lite option for the Compiler field.
from the menu of the model. Then select theTo use CodeSourcery Lite, the Language setting must also be changed for the model. Go to the Code Generation pane in the Configuration Parameters dialog and change the Language setting to C++. The C++ language is required because OpenCV is a C++ library.
The Vision Capture Image block supports only one USB camera attached to the target.
Limitations
Platform Support
The Vision blocks are currently only supported on the linux_verdex and linux_overo targets.
Compiler Support
Since OpenCV is a C++ library, the LLVM-GCC based cross-compilers cannot be used with the Vision blocks because they only support the C language. Instead, select either CodeSourcery Lite or Native GCC (compiles on target) for the Compiler setting on the Code Generation/QUARC pane of the dialog for the model. Note that use of the CodeSourcery Lite compiler requires that it be installed. Refer to Installing CodeSourcery for details on how to install this freely available compiler.
Language Support
Since OpenCV is a C++ library, the Language setting on the Code Generation/General tab of the for the model must be set to C++ when using the CodeSourcery cross-compiler. Otherwise the model will fail to build during the linking stage.
Input Ports
This block has no input ports.
Output Ports
image
A handle to an output image either in a matrix form or in an OpenCV (Open Source Computer Vision) IplImage structure. It uses 24 bit BGR (Blue-Green-Red) format to store image data.
new
A flag that indicates availability of a new image.
err
The error signal returns a negative value in case of failure to initialize and grab an image from the camera.
Parameters and Dialog Box
Image dimension
The options for source image diemnsion (width x height) are: 800 x 600, 640 x 480, 320 x 240, and 160 x 120.
Get output image as a matrix
The output image is an unsigned
8-bit matrix when this flag is selected.
Sample time
The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time. A sample time of -1 indicates that the block inherits its sample time.
Use 0.1 or higher for image size 320 x 240 and 160 x 120, and 0.5 or higher for 800 x 600 and 640 x 480.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
No |
No |
Not supported. |
|
No |
No |
Not supported. |
|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
No |
No |
Not supported. |
|
Rapid Simulation (RSIM) Target |
No |
No |
Not supported. |
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.