| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Module DocumentationThis modules 1) detects ArUco markers (small black-and-white geometric patterns which can be used as tags for some objects), and, in parallel, 2) isolates pixels within multiple given HSV ranges (hue, saturation, and value of color pixels), does some cleanups, and extracts object contours. It sends information about detected ArUco tags and color objects over serial. This module was developed to allow students to easily develop visually-guided robots that can at the same time detect ArUco markers placed in the environment to signal certain key objects (e.g., charging station, home base) and colored objects of different kinds (e.g., blue people, green trees, and yellow fires). This module usually works best with the camera sensor set to manual exposure, manual gain, manual color balance, etc so that HSV color values are reliable. See the file script.cfg file in this module's directory for an example of how to set the camera settings each time this module is loaded. Since this is a combination module, refer to:
The number of parallel blob trackers is determined by parameter The module runs at about 50 frames/s with 3 parallel blob detectors plus ArUco, at 320x240 camera sensor resolution. Increasing to 10 parallel blob detectors will still get you about 25 frames/s (but finding robust non-overlapping HSV ranges for all those detectors will become challenging!) To configure parameters Using the serial outputsWe recommend the following settings (to apply after you load the module, for example in the module's script.cfg file): setpar serout USB # to send to serial-over-USB, or use Hard to send to 4-pin serial port
setpar serstyle Normal # to get ID, center location, size for every detected color blob and ArUco tag
setpar serstamp Frame # to add video frame number to all messages
With a scene as shown in this module's screenshots, you would then get outputs like: ... 1557 N2 U42 -328 -9 706 569 1557 N2 U18 338 -241 613 444 1557 N2 blob0 616 91 406 244 1557 N2 blob1 28 584 881 331 1557 N2 blob2 47 -553 469 206 1558 N2 U42 -328 -9 706 569 1558 N2 U18 338 -241 613 444 1558 N2 blob0 547 113 519 275 1558 N2 blob1 28 581 881 338 1558 N2 blob2 47 -553 469 206 1559 N2 U42 -331 -13 700 563 1559 N2 U18 338 -244 613 450 1559 N2 blob0 369 153 200 194 1559 N2 blob0 616 94 381 250 1559 N2 blob1 28 581 881 338 1559 N2 blob2 47 -553 469 206 ... which basically means that, on frame 1557, ArUco markers U42 and U18 were detected, then blob detector named "blob0" (configured for light blue objects in script.cfg) detected one blob, then "blob1" (configured for yellow) also detected one, and finally "blob2" (configured for green) found one too. That was all for frame 1157, and we then switch to frame 1158 (with essentially the same detections), then frame 1159 (note how blob0 detected 2 different blobs on that frame), and so on. See Standardized serial messages formatting for more info about these messages. See Standardized serial messages formatting for more on standardized serial messages, and Helper functions to convert coordinates from camera resolution to standardized for more info on standardized coordinates. Running with no video output (standalone mode)Try these settings in the global initialization script file of JeVois, which is executed when JeVois powers up, in JEVOIS:/config/initscript.cfg: setmapping2 YUYV 320 240 45.0 JeVois ArUcoBlob # to select this module upon power up
setpar serout Hard # to send detection messages to 4-pin serial port
setpar serstyle Normal # to get ID, center location, size
setpar serstamp Frame # to add video frame number to all messages
streamon # start capturing and processing camera sensor data
Make sure you do not have conflicting settings in the module's params.cfg or script.cfg file; as a reminder, the order of execution is: 1) initscript.cfg runs, which loads the module through the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|