simple.h
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 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
00048
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