gradient.h

00001 /***************************************************************************
00002  *  gradient.h - Class defining a gradient (color) classifier
00003  *
00004  *  Created: Tue Jun 10 11:48:00 2008
00005  *  Copyright  2008 Christof Rath <christof.rath@gmail.com>
00006  *
00007  ****************************************************************************/
00008
00009 /*  This program is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version. A runtime exception applies to
00013  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00021  */
00022
00023 #ifndef __FIREVISION_CLASSIFIERS_GRADIENT_H_
00024 #define __FIREVISION_CLASSIFIERS_GRADIENT_H_
00025 
00026 #include "classifier.h"
00027 #include "qualifiers.h"
00028
00029 #include <models/scanlines/grid.h>
00030
00031
00032 class GradientClassifier: public Classifier
00033 {
00034  public:
00035   GradientClassifier(std::list<ScanlineGrid* >* scanlines, Qualifier* q,
00036                      unsigned int threshold, unsigned int max_size = 0,
00037                      bool use_rising_flank = true,
00038                      bool use_falling_flank = true);
00039   virtual ~GradientClassifier();
00040
00041   virtual std::list< ROI > * classify();
00042   virtual void set_src_buffer(unsigned char *yuv422_planar,
00043                               unsigned int width, unsigned int height);
00044
00045   virtual void set_threshold(unsigned int threshold, unsigned int max_size = 0);
00046   virtual void set_edges(bool use_rising_edge, bool use_falling_edge);
00047
00048  private:
00049   int             _last_val;
00050   fawkes::point_t _last_pos;
00051
00052   unsigned int _threshold;
00053   unsigned int _max_size;
00054
00055   std::list<ScanlineGrid* >* _scanlines;
00056   Qualifier* _q;
00057
00058   bool _use_falling_edge;
00059   bool _use_rising_edge;
00060 };
00061
00062 #endif // __FIREVISION_CLASSIFIERS_GRADIENT_H_