Fawkes API
Fawkes Development Version
|
Matches colors that are similar to given reference colors. More...
#include <>>
Classes | |
struct | color_class_t |
Parameters that define a certain color. More... | |
Public Types | |
typedef struct firevision::ColorModelSimilarity::color_class_t | color_class_t |
Parameters that define a certain color. More... | |
Public Member Functions | |
virtual color_t | determine (unsigned int y, unsigned int u, unsigned int v) const |
Determine the color class of a given YUV value. More... | |
virtual const char * | get_name () |
Get name of color model. More... | |
void | add_color (color_class_t *color_class) |
Add a color to be recognized by this colormodel. More... | |
void | add_colors (std::vector< color_class_t *> color_classes) |
Add multiple colors to this colormodel. More... | |
void | delete_colors () |
Remove all colors from this colormodel. More... | |
![]() | |
virtual | ~ColorModel () |
Virtual empty destructor. More... | |
virtual void | uv_to_image (unsigned char *yuv422_planar_buffer, unsigned int y) |
Create image from color model. More... | |
Matches colors that are similar to given reference colors.
Definition at line 40 of file similarity.h.
typedef struct firevision::ColorModelSimilarity::color_class_t firevision::ColorModelSimilarity::color_class_t |
Parameters that define a certain color.
void firevision::ColorModelSimilarity::add_color | ( | color_class_t * | color_class | ) |
Add a color to be recognized by this colormodel.
color_class | The ColorModelSimilarity::color_class_t that will be returned by ColorModelSimilarity::determine on a match ColorModelSimilarity::color_class_t |
Definition at line 83 of file similarity.cpp.
Referenced by firevision::ColorModelSimilarity::color_class_t::color_class_t().
void firevision::ColorModelSimilarity::add_colors | ( | std::vector< color_class_t *> | color_classes | ) |
Add multiple colors to this colormodel.
color_classes | A list of |
Definition at line 90 of file similarity.cpp.
Referenced by firevision::ColorModelSimilarity::color_class_t::color_class_t().
void firevision::ColorModelSimilarity::delete_colors | ( | ) |
Remove all colors from this colormodel.
Definition at line 96 of file similarity.cpp.
Referenced by firevision::ColorModelSimilarity::color_class_t::color_class_t().
|
virtual |
Determine the color class of a given YUV value.
Color classes have to be defined beforehand with ColorModelSimilarity::add_color. If multiple color classes have been defined, they are tried in reverse order, i.e. the class that has been added last is tried first. We return on the first match, so think of the color classes as a priority list.
y | Luminance (ignored) |
u | Chroma U |
v | Chroma V |
Implements firevision::ColorModel.
Definition at line 58 of file similarity.cpp.
Referenced by firevision::FilterColorThreshold::apply().
|
virtual |
Get name of color model.
Implements firevision::ColorModel.
Definition at line 44 of file similarity.cpp.