Using The On-Board Camera - Quanser qbot User Manual

Table of Contents

Advertisement

Quanser Qbot: User Manual

5.4. Using the on-board camera

The Qbot is equipped with a Logitech QuickCam Pro 9000 USB camera. When connected
to the on-board Gumstix Verdex computer, this camera is capable of capturing up to 9
frames per second (fps). In order to acquire and display images on the host computer during
execution some additional blocks are required. Figure 15 shows an example model where
images are acquired and displayed.
Figure 15: Capturing and displaying images in QUARC.
The Vision Capture Image block is used to capture image data from the camera. The Vision
Get Iplimage Data block simply takes the image and outputs the image data as a matrix. For
the Qbot camera, color images are output as 3-dimensional matrices (3 x ImageWidth x Im-
ageHeight) with each pixel represented by a 3-vector of [Blue, Green, Red] values between
0 and 255.
The Display Image block is used to display images on the host. This block acts like a scope
and will not delay the execution of the real-time model. The images displayed in the Display
Image block may be delayed compared to the actual image data being acquired and used in
the real-time model. The Image Convert block is used to convert the image format from the
Qbot camera (BGR8) to a format that can be displayed in MATLAB.
Note: since displaying images on the host requires a large amount of bandwidth, it is
recommended that the Display Image block be run with a sample time of 0.1 seconds or
slower. If the error "Warning: Not enough memory on the target to process the packet:
EXT_SELECT_SIGNALS" is displayed in the MATLAB Command window or data on
Scopes and the Display Image block are not displayed during model execution, the size of
the external mode buffer is too large. The Display Image block acts like a Scope and
uploads its signal (the image signal) to the host for display through Simulink's external
mode buffers. In order to resolve this issue so that images and data will be displayed the
buffer size should be reduced. To reduce the size of the buffer, either increase the model's
base rate so that it is faster or reduce the number of base rate samples used in the model's
external mode buffer by decreasing the Duration (recommended 1 to 10) in the Signal &
Triggering menu under Tools > External Mode Control Panel > Signal & Triggering.
Because the vision blocks require OpenCV2.2, models using these vision blocks must be
configured for code generation in C++. To set this parameter select the menu option
Document Number: 830  Revision: 7  Page: 17

Advertisement

Table of Contents
loading

Table of Contents