Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * simple.h - Header for ReallySimpleClassifier 00004 * 00005 * Created: Wed May 18 11:39:10 2005 00006 * Copyright 2005-2007 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __FIREVISION_CLASSIFIERS_SIMPLE_H_ 00025 #define __FIREVISION_CLASSIFIERS_SIMPLE_H_ 00026 00027 #include <fvclassifiers/classifier.h> 00028 #include <fvutils/base/types.h> 00029 00030 namespace firevision { 00031 #if 0 /* just to make Emacs auto-indent happy */ 00032 } 00033 #endif 00034 00035 class ScanlineModel; 00036 class ColorModel; 00037 00038 class SimpleColorClassifier : public Classifier 00039 { 00040 public: 00041 SimpleColorClassifier(ScanlineModel *scanline_model, 00042 ColorModel *color_model, 00043 unsigned int min_num_points=6, 00044 unsigned int box_extent = 50, 00045 bool upward = false, 00046 unsigned int neighbourhood_min_match = 8, 00047 unsigned int grow_by = 10, 00048 color_t color = C_ORANGE); 00049 00050 virtual std::list< ROI > * classify(); 00051 00052 virtual void get_mass_point_of_color(ROI *roi, fawkes::point_t *massPoint); 00053 private: 00054 unsigned int consider_neighbourhood(unsigned int x, unsigned int y, color_t what); 00055 00056 unsigned char *src; 00057 00058 unsigned int width; 00059 unsigned int height; 00060 00061 unsigned int neighbourhood_min_match; 00062 unsigned int grow_by; 00063 00064 bool modified; 00065 unsigned int min_num_points; 00066 unsigned int box_extent; 00067 00068 bool upward; 00069 00070 ScanlineModel *scanline_model; 00071 ColorModel *color_model; 00072 00073 const color_t color; 00074 }; 00075 00076 } // end namespace firevision 00077 00078 #endif