Fawkes API  Fawkes Development Version
thresholds_luminance.h
1 
2 /**************************************************************************
3  * thresholds.h - This header defines thresholds for color classification
4  *
5  * Created: Wed May 11 11:22:00 2005
6  * Copyright 2005 Martin Heracles <Martin.Heracles@rwth-aachen.de>
7  * Tim Niemueller [www.niemueller.de]
8  *
9  ***************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version. A runtime exception applies to
15  * this software (see LICENSE.GPL_WRE file mentioned below for details).
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23  */
24 
25 #ifndef __FIREVISION_COLORMODEL_LUMINANCE_H_
26 #define __FIREVISION_COLORMODEL_LUMINANCE_H_
27 
28 #include <fvmodels/color/colormodel.h>
29 
30 namespace firevision {
31 #if 0 /* just to make Emacs auto-indent happy */
32 }
33 #endif
34 
35 /* The following thresholds define certain color regions in the
36  two-dimensional UV-Colorspace (ignoring the Y-component).
37  It is assumed that the Y-, U- and V-components range from 0 to 255 each,
38  and that (0, 0) is at the lower left corner. */
39 
40 // 2/3 * 255
41 #define THRESHOLD_WHITE_Y_LOW 170
42 
43 
45 {
46  public:
47  ColorModelLuminance(const unsigned int threshold_white_low = THRESHOLD_WHITE_Y_LOW);
48 
49  color_t determine(unsigned int y,
50  unsigned int u,
51  unsigned int v) const;
52 
53  const char * get_name();
54  void print_thresholds();
55  private:
56  unsigned int threshold_white_low_;
57 
58 };
59 
60 } // end namespace firevision
61 
62 #endif
Really simple thresholds-based model with some hard-coded thresholds.
Color model interface.
Definition: colormodel.h:34
color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine classification of YUV pixel.
const char * get_name()
Get name of color model.
void print_thresholds()
Print the thresholds to stdout.
ColorModelLuminance(const unsigned int threshold_white_low=THRESHOLD_WHITE_Y_LOW)
Constructor.