Fawkes API  Fawkes Development Version
multi_color.h
00001 
00002 /***************************************************************************
00003  *  multi-color.h - Header for multi color classifier
00004  *
00005  *  Created: Sat Apr 02 09:51:27 2011
00006  *  Copyright  2005-2011  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_MULTI_COLOR_H_
00025 #define __FIREVISION_CLASSIFIERS_MULTI_COLOR_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 MultiColorClassifier : public Classifier
00039 {
00040  public:
00041   MultiColorClassifier(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 
00049   virtual std::list< ROI > * classify();
00050 
00051   virtual void get_mass_point_of_color(ROI *roi, fawkes::point_t *massPoint);
00052  private:
00053   unsigned int consider_neighbourhood(unsigned int x, unsigned int y, color_t what);
00054 
00055   unsigned char *src;
00056 
00057   unsigned int width;
00058   unsigned int height;
00059 
00060   unsigned int neighbourhood_min_match;
00061   unsigned int grow_by;
00062 
00063   bool         modified;
00064   unsigned int min_num_points;
00065   unsigned int box_extent;
00066 
00067   bool         upward;
00068 
00069   ScanlineModel *scanline_model;
00070   ColorModel    *color_model;
00071 };
00072 
00073 } // end namespace firevision
00074 
00075 #endif