24 #include <fvutils/color/color_object_map.h>
26 namespace firevision {
70 ColorObjectMap *ColorObjectMap::singleton_ =
new ColorObjectMap();
75 ColorObjectMap::ColorObjectMap()
78 h_unknown_ = H_UNKNOWN;
81 set_mapping(H_BALL, C_ORANGE);
82 set_mapping(H_ROBOT, C_BLACK);
83 set_mapping(H_ROBOT_OPP, C_RED);
84 set_mapping(H_FIELD, C_GREEN);
85 set_mapping(H_GOAL_YELLOW, C_YELLOW);
86 set_mapping(H_GOAL_BLUE, C_CYAN);
87 set_mapping(H_LINE, C_WHITE);
88 set_mapping(H_BACKGROUND, C_BACKGROUND);
133 ColorObjectMap::set_mapping(hint_t roi, color_t color)
135 hint_t cur_roi =
get(color);
136 if (cur_roi != H_UNKNOWN)
138 color_t cur_col =
get(roi);
139 color_for_hint_[cur_roi] = C_OTHER;
140 hint_for_color_[cur_col] = H_UNKNOWN;
143 color_for_hint_[roi] = color;
144 hint_for_color_[color] = roi;
static YUV_t get_color(color_t color)
YUV_t getter.
color_t get(hint_t hint) const
Inline color_t reference getter.
~ColorObjectMap()
Destructor.
static YUV_t_struct gray()
static YUV_t_struct cyan()
static YUV_t_struct green()
static YUV_t_struct orange()
static YUV_t_struct blue()
static YUV_t_struct magenta()
static YUV_t_struct white()
static YUV_t_struct yellow()
static YUV_t_struct black()
static YUV_t_struct red()