Fawkes API Fawkes Development Version
gradient.h
1/***************************************************************************
2 * gradient.h - Class defining a gradient (color) classifier
3 *
4 * Created: Tue Jun 10 11:48:00 2008
5 * Copyright 2008 Christof Rath <christof.rath@gmail.com>
6 *
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version. A runtime exception applies to
13 * this software (see LICENSE.GPL_WRE file mentioned below for details).
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Library General Public License for more details.
19 *
20 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21 */
22
23#ifndef _FIREVISION_CLASSIFIERS_GRADIENT_H_
24#define _FIREVISION_CLASSIFIERS_GRADIENT_H_
25
26#include <fvclassifiers/classifier.h>
27#include <fvclassifiers/qualifiers.h>
28#include <fvmodels/scanlines/grid.h>
29
30namespace firevision {
31
33{
34public:
35 GradientClassifier(std::list<ScanlineGrid *> *scanlines,
36 Qualifier * q,
37 unsigned int threshold,
38 unsigned int max_size = 0,
39 bool use_rising_flank = true,
40 bool use_falling_flank = true);
41 virtual ~GradientClassifier();
42
43 virtual std::list<ROI> *classify();
44 virtual void
45 set_src_buffer(unsigned char *yuv422_planar, unsigned int width, unsigned int height);
46
47 virtual void set_threshold(unsigned int threshold, unsigned int max_size = 0);
48 virtual void set_edges(bool use_rising_edge, bool use_falling_edge);
49
50private:
51 int _last_val;
52 fawkes::upoint_t _last_pos;
53
54 unsigned int _threshold;
55 unsigned int _max_size;
56
57 std::list<ScanlineGrid *> *_scanlines;
58 Qualifier * _q;
59
60 bool _use_falling_edge;
61 bool _use_rising_edge;
62};
63
64} // end namespace firevision
65
66#endif // FIREVISION_CLASSIFIERS_GRADIENT_H__
Classifier to extract regions of interest.
Definition: classifier.h:36
Gradient classifier.
Definition: gradient.h:33
virtual void set_threshold(unsigned int threshold, unsigned int max_size=0)
Threshold setter.
Definition: gradient.cpp:83
virtual void set_edges(bool use_rising_edge, bool use_falling_edge)
Edge setter.
Definition: gradient.cpp:98
virtual std::list< ROI > * classify()
Classify image.
Definition: gradient.cpp:122
GradientClassifier(std::list< ScanlineGrid * > *scanlines, Qualifier *q, unsigned int threshold, unsigned int max_size=0, bool use_rising_flank=true, bool use_falling_flank=true)
Constructor.
Definition: gradient.cpp:49
virtual void set_src_buffer(unsigned char *yuv422_planar, unsigned int width, unsigned int height)
Set source buffer.
Definition: gradient.cpp:112
virtual ~GradientClassifier()
Destructor.
Definition: gradient.cpp:72
Abstract Qualifier for a single pixel.
Definition: qualifiers.h:31
Point with cartesian coordinates as unsigned integers.
Definition: types.h:35