Fawkes API  Fawkes Development Version
firevision::ColorModelSimilarity Class Reference

#include <>>

Inheritance diagram for firevision::ColorModelSimilarity:

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 ()
 
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...
 
- Public Member Functions inherited from firevision::ColorModel
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...
 

Detailed Description

Matches colors that are similar to given reference colors.

Author
Victor Mataré

Definition at line 50 of file similarity.h.

Member Typedef Documentation

◆ color_class_t

Member Function Documentation

◆ add_color()

void firevision::ColorModelSimilarity::add_color ( color_class_t color_class)

Add a color to be recognized by this colormodel.

Parameters
color_classThe ColorModelSimilarity::color_class_t that will be returned by ColorModelSimilarity::determine on a match ColorModelSimilarity::color_class_t

Definition at line 111 of file similarity.cpp.

◆ add_colors()

void firevision::ColorModelSimilarity::add_colors ( std::vector< color_class_t * >  color_classes)

Add multiple colors to this colormodel.

Parameters
color_classesA list of

Definition at line 120 of file similarity.cpp.

◆ delete_colors()

void firevision::ColorModelSimilarity::delete_colors ( )

Remove all colors from this colormodel.

Definition at line 128 of file similarity.cpp.

◆ determine()

color_t firevision::ColorModelSimilarity::determine ( unsigned int  y,
unsigned int  u,
unsigned int  v 
) const
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.

Parameters
yLuminance (ignored)
uChroma U
vChroma V
Returns
The color_t value from the matching color class, or C_OTHER if no match was found.

Implements firevision::ColorModel.

Definition at line 73 of file similarity.cpp.

◆ get_name()

const char * firevision::ColorModelSimilarity::get_name ( )
virtual

Get name of color model.

Returns
name of color model.
Author
Tim Niemueller

Implements firevision::ColorModel.

Definition at line 57 of file similarity.cpp.


The documentation for this class was generated from the following files: