27 #include "similarity.h"
29 #include <fvutils/color/threshold.h>
30 #include <fvutils/color/yuv.h>
35 namespace firevision {
42 ColorModelSimilarity::ColorModelSimilarity()
49 return "ColorModelSimilarity";
65 for (std::vector<color_class_t *>::const_iterator it = color_classes_.begin();
66 it != color_classes_.end();
68 if ((*it)->luma_threshold >= 0) {
76 (*it)->chroma_threshold,
77 (*it)->saturation_threshold,
78 (*it)->luma_threshold)) {
82 if (is_similar(u - 0x80,
87 (*it)->chroma_threshold,
88 (*it)->saturation_threshold)) {
103 color_classes_.push_back(color_class);
112 color_classes_.insert(color_classes_.end(), color_classes.begin(), color_classes.end());
120 color_classes_.clear();
virtual const char * get_name()
Get name of color model.
void add_color(color_class_t *color_class)
Add a color to be recognized by this colormodel.
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine the color class of a given YUV value.
void add_colors(std::vector< color_class_t * > color_classes)
Add multiple colors to this colormodel.
void delete_colors()
Remove all colors from this colormodel.
Parameters that define a certain color.