Fawkes API  Fawkes Development Version
simple.h
1 
2 /***************************************************************************
3  * simple.h - Header for ReallySimpleClassifier
4  *
5  * Created: Wed May 18 11:39:10 2005
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _FIREVISION_CLASSIFIERS_SIMPLE_H_
25 #define _FIREVISION_CLASSIFIERS_SIMPLE_H_
26 
27 #include <fvclassifiers/classifier.h>
28 #include <fvutils/base/types.h>
29 
30 namespace firevision {
31 
32 class ScanlineModel;
33 class ColorModel;
34 
35 class SimpleColorClassifier : public Classifier
36 {
37 public:
38  SimpleColorClassifier(ScanlineModel *scanline_model,
39  ColorModel * color_model,
40  unsigned int min_num_points = 6,
41  unsigned int box_extent = 50,
42  bool upward = false,
43  unsigned int neighbourhood_min_match = 8,
44  unsigned int grow_by = 10,
45  color_t color = C_ORANGE);
46 
47  virtual std::list<ROI> *classify();
48 
49  virtual void get_mass_point_of_color(ROI *roi, fawkes::upoint_t *massPoint);
50 
51 private:
52  unsigned int consider_neighbourhood(unsigned int x, unsigned int y, color_t what);
53 
54  unsigned int neighbourhood_min_match;
55  unsigned int grow_by;
56 
57  bool modified;
58  unsigned int min_num_points;
59  unsigned int box_extent;
60 
61  bool upward;
62 
63  ScanlineModel *scanline_model;
64  ColorModel * color_model;
65 
66  const color_t color;
67 };
68 
69 } // end namespace firevision
70 
71 #endif
fawkes::upoint_t
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
firevision::ROI
Definition: roi.h:60
firevision::ScanlineModel
Definition: scanlinemodel.h:58
firevision::SimpleColorClassifier::classify
virtual std::list< ROI > * classify()
Definition: simple.cpp:133
firevision::SimpleColorClassifier::SimpleColorClassifier
SimpleColorClassifier(ScanlineModel *scanline_model, ColorModel *color_model, unsigned int min_num_points=6, unsigned int box_extent=50, bool upward=false, unsigned int neighbourhood_min_match=8, unsigned int grow_by=10, color_t color=C_ORANGE)
Constructor.
Definition: simple.cpp:58
firevision::ColorModel
Definition: colormodel.h:37
firevision::SimpleColorClassifier::get_mass_point_of_color
virtual void get_mass_point_of_color(ROI *roi, fawkes::upoint_t *massPoint)
Get mass point of primary color.
Definition: simple.cpp:279