simple.h

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 class ScanlineModel;
00030 class ColorModel;
00031
00032 class SimpleColorClassifier : public Classifier
00033 {
00034  public:
00035   SimpleColorClassifier(ScanlineModel *scanline_model,
00036                         ColorModel *color_model,
00037                         unsigned int min_num_points=6,
00038                         unsigned int box_extent = 50,
00039                         bool upward = false,
00040                         unsigned int neighbourhood_min_match = 8,
00041                         unsigned int grow_by = 10                );
00042
00043   virtual std::list< ROI > * classify();
00044
00045   virtual void get_mass_point_of_ball( ROI *roi, fawkes::point_t *massPoint );
00046 
00047   /** Sets the object of interest (hint_t)
00048    * @param hint Object of interest
00049    */
00050   virtual void set_hint (hint_t hint);
00051   virtual void add_hint (hint_t hint);
00052
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   std::list<color_t> colors_of_interest;
00074 };
00075
00076 #endif