00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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
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
00053
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 }
00082
00083 #endif