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 <classifiers/classifier.h> 00028 00029 namespace firevision { 00030 #if 0 /* just to make Emacs auto-indent happy */ 00031 } 00032 #endif 00033 00034 class ScanlineModel; 00035 class ColorModel; 00036 00037 class SimpleColorClassifier : public Classifier 00038 { 00039 public: 00040 SimpleColorClassifier(ScanlineModel *scanline_model, 00041 ColorModel *color_model, 00042 unsigned int min_num_points=6, 00043 unsigned int box_extent = 50, 00044 bool upward = false, 00045 unsigned int neighbourhood_min_match = 8, 00046 unsigned int grow_by = 10 ); 00047 00048 virtual std::list< ROI > * classify(); 00049 00050 virtual void get_mass_point_of_ball( ROI *roi, fawkes::point_t *massPoint ); 00051 00052 /** Sets the object of interest (hint_t) 00053 * @param hint Object of interest 00054 */ 00055 virtual void set_hint (hint_t hint); 00056 virtual void add_hint (hint_t hint); 00057 00058 private: 00059 unsigned int consider_neighbourhood(unsigned int x, unsigned int y, color_t what); 00060 00061 unsigned char *src; 00062 00063 unsigned int width; 00064 unsigned int height; 00065 00066 unsigned int neighbourhood_min_match; 00067 unsigned int grow_by; 00068 00069 bool modified; 00070 unsigned int min_num_points; 00071 unsigned int box_extent; 00072 00073 bool upward; 00074 00075 ScanlineModel *scanline_model; 00076 ColorModel *color_model; 00077 00078 std::list<color_t> colors_of_interest; 00079 }; 00080 00081 } // end namespace firevision 00082 00083 #endif