Fawkes API
Fawkes Development Version
|
00001 00002 /************************************************************************** 00003 * thresholds.h - This header defines thresholds for color classification 00004 * 00005 * Created: Wed May 11 11:22:00 2005 00006 * Copyright 2005 Martin Heracles <Martin.Heracles@rwth-aachen.de> 00007 * Tim Niemueller [www.niemueller.de] 00008 * 00009 ***************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. A runtime exception applies to 00015 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Library General Public License for more details. 00021 * 00022 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00023 */ 00024 00025 #ifndef __FIREVISION_COLORMODEL_THRESHOLDS_H_ 00026 #define __FIREVISION_COLORMODEL_THRESHOLDS_H_ 00027 00028 #include <fvmodels/color/colormodel.h> 00029 00030 namespace firevision { 00031 #if 0 /* just to make Emacs auto-indent happy */ 00032 } 00033 #endif 00034 00035 /* The following thresholds define certain color regions in the 00036 two-dimensional UV-Colorspace (ignoring the Y-component). 00037 It is assumed that the Y-, U- and V-components range from 0 to 255 each, 00038 and that (0, 0) is at the lower left corner. */ 00039 00040 // 1/8 * 255 = 31 00041 #define THRESHOLD_ORANGE_U_LOW 0 00042 00043 // 3/8 * 255 = 94 00044 #define THRESHOLD_ORANGE_U_HIGH 120 00045 00046 // 3/4 * 255 = 191 00047 #define THRESHOLD_ORANGE_V_LOW 170 00048 00049 // 5/8 * 255 00050 #define THRESHOLD_MAGENTA_U_LOW 159 00051 00052 // 5/8 * 255 00053 #define THRESHOLD_MAGENTA_V_LOW 159 00054 00055 //1/4 * 255 00056 #define THRESHOLD_CYAN_U_LOW 63 00057 00058 // 5/8 * 255 00059 #define THRESHOLD_CYAN_U_HIGH 159 00060 00061 //1/4 * 255 00062 #define THRESHOLD_CYAN_V_HIGH 63 00063 00064 // 3/4 * 255 00065 #define THRESHOLD_BLUE_U_LOW 191 00066 00067 // 0 :-) 00068 #define THRESHOLD_BLUE_V_HIGH 90 00069 00070 // 1/8 * 255 00071 #define THRESHOLD_YELLOW_U_HIGH 31 00072 00073 // 3/4 * 255 00074 #define THRESHOLD_YELLOW_V_LOW 191 00075 00076 //1/4 * 255 00077 #define THRESHOLD_GREEN_U_HIGH 63 00078 00079 // 5/8 * 255 00080 #define THRESHOLD_GREEN_V_HIGH 159 00081 00082 // 2/3 * 255 00083 #define THRESHOLD_WHITE_Y_LOW 170 00084 00085 00086 class ColorModelThresholds : public ColorModel 00087 { 00088 public: 00089 00090 color_t determine(unsigned int y, 00091 unsigned int u, 00092 unsigned int v) const; 00093 00094 const char * get_name(); 00095 void print_thresholds(); 00096 00097 }; 00098 00099 } // end namespace firevision 00100 00101 #endif