Paparazzi UAS  v5.15_devel-202-ge01e8fc
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cv_detect_color_object module

Color Object Detector

Detects an object by a continuous color. Optionally draws on image.

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

1 <module name="video_thread"/>
2 <module name="cv_detect_color_object">
3  <define name="COLOR_OBJECT_DETECTOR_CAMERA1" value="front_camera|bottom_camera" />
4  <define name="COLOR_OBJECT_DETECTOR_FPS1" value="0" />
5  <define name="COLOR_OBJECT_DETECTOR_LUM_MIN1" value="0" />
6  <define name="COLOR_OBJECT_DETECTOR_LUM_MAX1" value="0" />
7  <define name="COLOR_OBJECT_DETECTOR_CB_MIN1" value="0" />
8  <define name="COLOR_OBJECT_DETECTOR_CB_MAX1" value="0" />
9  <define name="COLOR_OBJECT_DETECTOR_CR_MIN1" value="0" />
10  <define name="COLOR_OBJECT_DETECTOR_CR_MAX1" value="0" />
11  <define name="COLOR_OBJECT_DETECTOR_DRAW1" value="FALSE|TRUE" />
12  <define name="COLOR_OBJECT_DETECTOR_CAMERA2" value="front_camera|bottom_camera" />
13  <define name="COLOR_OBJECT_DETECTOR_FPS2" value="0" />
14  <define name="COLOR_OBJECT_DETECTOR_LUM_MIN2" value="0" />
15  <define name="COLOR_OBJECT_DETECTOR_LUM_MAX2" value="0" />
16  <define name="COLOR_OBJECT_DETECTOR_CB_MIN2" value="0" />
17  <define name="COLOR_OBJECT_DETECTOR_CB_MAX2" value="0" />
18  <define name="COLOR_OBJECT_DETECTOR_CR_MIN2" value="0" />
19  <define name="COLOR_OBJECT_DETECTOR_CR_MAX2" value="0" />
20  <define name="COLOR_OBJECT_DETECTOR_DRAW2" value="FALSE|TRUE" />
21 </module>

Module configuration options

Define Options

  • name: COLOR_OBJECT_DETECTOR_CAMERA1 value: front_camera|bottom_camera
    Description: Video device to use
  • name: COLOR_OBJECT_DETECTOR_FPS1 value: 0
    Description: Desired FPS (0: camera rate)
  • name: COLOR_OBJECT_DETECTOR_LUM_MIN1 value: 0
    Description: Filter 1 min luminance
  • name: COLOR_OBJECT_DETECTOR_LUM_MAX1 value: 0
    Description: Filter 1 max luminance
  • name: COLOR_OBJECT_DETECTOR_CB_MIN1 value: 0
    Description: Filter 1 min blue chroma
  • name: COLOR_OBJECT_DETECTOR_CB_MAX1 value: 0
    Description: Filter 1 max blue chroma
  • name: COLOR_OBJECT_DETECTOR_CR_MIN1 value: 0
    Description: Filter 1 min red chroma
  • name: COLOR_OBJECT_DETECTOR_CR_MAX1 value: 0
    Description: Filter 1 max red chroma
  • name: COLOR_OBJECT_DETECTOR_DRAW1 value: FALSE|TRUE
    Description: Whether or not to draw on image
  • name: COLOR_OBJECT_DETECTOR_CAMERA2 value: front_camera|bottom_camera
    Description: Video device to use
  • name: COLOR_OBJECT_DETECTOR_FPS2 value: 0
    Description: Desired FPS (0: camera rate)
  • name: COLOR_OBJECT_DETECTOR_LUM_MIN2 value: 0
    Description: Filter 1 min luminance
  • name: COLOR_OBJECT_DETECTOR_LUM_MAX2 value: 0
    Description: Filter 2 max luminance
  • name: COLOR_OBJECT_DETECTOR_CB_MIN2 value: 0
    Description: Filter 2 min blue chroma
  • name: COLOR_OBJECT_DETECTOR_CB_MAX2 value: 0
    Description: Filter 2 max blue chroma
  • name: COLOR_OBJECT_DETECTOR_CR_MIN2 value: 0
    Description: Filter 2 min red chroma
  • name: COLOR_OBJECT_DETECTOR_CR_MAX2 value: 0
    Description: Filter 2 max red chroma
  • name: COLOR_OBJECT_DETECTOR_DRAW2 value: FALSE|TRUE
    Description: Whether or not to draw on image

Dependencies

Module functions

Init Functions

These initialization functions are called once on startup.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw cv_detect_color_object.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="cv_detect_color_object" dir="computer_vision">
<doc>
<description>Color Object Detector
Detects an object by a continuous color. Optionally draws on image.
</description>
<define name="COLOR_OBJECT_DETECTOR_CAMERA1" value="front_camera|bottom_camera" description="Video device to use"/>
<define name="COLOR_OBJECT_DETECTOR_FPS1" value="0" description="Desired FPS (0: camera rate)"/>
<define name="COLOR_OBJECT_DETECTOR_LUM_MIN1" value="0" description="Filter 1 min luminance"/>
<define name="COLOR_OBJECT_DETECTOR_LUM_MAX1" value="0" description="Filter 1 max luminance"/>
<define name="COLOR_OBJECT_DETECTOR_CB_MIN1" value="0" description="Filter 1 min blue chroma"/>
<define name="COLOR_OBJECT_DETECTOR_CB_MAX1" value="0" description="Filter 1 max blue chroma"/>
<define name="COLOR_OBJECT_DETECTOR_CR_MIN1" value="0" description="Filter 1 min red chroma"/>
<define name="COLOR_OBJECT_DETECTOR_CR_MAX1" value="0" description="Filter 1 max red chroma"/>
<define name="COLOR_OBJECT_DETECTOR_DRAW1" value="FALSE|TRUE" description="Whether or not to draw on image"/>
<define name="COLOR_OBJECT_DETECTOR_CAMERA2" value="front_camera|bottom_camera" description="Video device to use"/>
<define name="COLOR_OBJECT_DETECTOR_FPS2" value="0" description="Desired FPS (0: camera rate)"/>
<define name="COLOR_OBJECT_DETECTOR_LUM_MIN2" value="0" description="Filter 1 min luminance"/>
<define name="COLOR_OBJECT_DETECTOR_LUM_MAX2" value="0" description="Filter 2 max luminance"/>
<define name="COLOR_OBJECT_DETECTOR_CB_MIN2" value="0" description="Filter 2 min blue chroma"/>
<define name="COLOR_OBJECT_DETECTOR_CB_MAX2" value="0" description="Filter 2 max blue chroma"/>
<define name="COLOR_OBJECT_DETECTOR_CR_MIN2" value="0" description="Filter 2 min red chroma"/>
<define name="COLOR_OBJECT_DETECTOR_CR_MAX2" value="0" description="Filter 2 max red chroma"/>
<define name="COLOR_OBJECT_DETECTOR_DRAW2" value="FALSE|TRUE" description="Whether or not to draw on image"/>
</doc>
<settings>
<dl_settings>
<dl_settings name="ColorObjectDetector">
<dl_setting var="cod_lum_min1" min="0" step="1" max="255" shortname="y_min1"/>
<dl_setting var="cod_lum_max1" min="0" step="1" max="255" shortname="y_max1"/>
<dl_setting var="cod_cb_min1" min="0" step="1" max="255" shortname="u_min1"/>
<dl_setting var="cod_cb_max1" min="0" step="1" max="255" shortname="u_max1"/>
<dl_setting var="cod_cr_min1" min="0" step="1" max="255" shortname="v_min1"/>
<dl_setting var="cod_cr_max1" min="0" step="1" max="255" shortname="v_max1"/>
<dl_setting var="cod_draw1" min="0" step="1" max="1" values="False|True" shortname="draw 1" />
<dl_setting var="cod_lum_min2" min="0" step="1" max="255" shortname="y_min2"/>
<dl_setting var="cod_lum_max2" min="0" step="1" max="255" shortname="y_max2"/>
<dl_setting var="cod_cb_min2" min="0" step="1" max="255" shortname="u_min2"/>
<dl_setting var="cod_cb_max2" min="0" step="1" max="255" shortname="u_max2"/>
<dl_setting var="cod_cr_min2" min="0" step="1" max="255" shortname="v_min2"/>
<dl_setting var="cod_cr_max2" min="0" step="1" max="255" shortname="v_max2"/>
<dl_setting var="cod_draw2" min="0" step="1" max="1" values="False|True" shortname="draw 2" />
</dl_settings>
</dl_settings>
</settings>
<depends>video_thread</depends>
<header>
<file name="cv_detect_color_object.h"/>
</header>
<init fun="color_object_detector_init()"/>
<periodic fun="color_object_detector_periodic()" freq="50"/>
<makefile target="ap|nps">
<file name="cv_detect_color_object.c"/>
</makefile>
</module>