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
30namespace firevision {
31
32/* The following thresholds define certain color regions in the
33 two-dimensional UV-Colorspace (ignoring the Y-component).
34 It is assumed that the Y-, U- and V-components range from 0 to 255 each,
35 and that (0, 0) is at the lower left corner. */
36
37// 2/3 * 255
38#define THRESHOLD_WHITE_Y_LOW 170
39
41{
42public:
43 ColorModelLuminance(const unsigned int threshold_white_low = THRESHOLD_WHITE_Y_LOW);
44
45 color_t determine(unsigned int y, unsigned int u, unsigned int v) const;
46
47 const char *get_name();
48 void print_thresholds();
49
50private:
51 unsigned int threshold_white_low_;
52};
53
54} // end namespace firevision
55
56#endif
Really simple thresholds-based model with some hard-coded thresholds.
void print_thresholds()
Print the thresholds to stdout.
const char * get_name()
Get name of color model.
color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine classification of YUV pixel.
ColorModelLuminance(const unsigned int threshold_white_low=THRESHOLD_WHITE_Y_LOW)
Constructor.
Color model interface.
Definition: colormodel.h:32