Fawkes API Fawkes Development Version
threshold.h
1
2/***************************************************************************
3 * threshold.h - Header of threshold filter
4 *
5 * Created: Tue Jun 07 14:25:53 2005
6 * Copyright 2005-2012 Tim Niemueller [www.niemueller.de]
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_FILTER_THRESHOLD_H_
24#define _FIREVISION_FILTER_THRESHOLD_H_
25
26#if !(defined(HAVE_IPP) || defined(HAVE_OPENCV))
27# error "Neither IPP nor OpenCV installed"
28#endif
29
30#include <fvfilters/filter.h>
31
32namespace firevision {
33
34class FilterThreshold : public Filter
35{
36public:
37 FilterThreshold(unsigned char min = 128,
38 unsigned char min_replace = 0,
39 unsigned char max = 127,
40 unsigned char max_replace = 255);
41
42 void set_thresholds(unsigned char min,
43 unsigned char min_replace,
44 unsigned char max,
45 unsigned char max_replace);
46
47 virtual void apply();
48
49private:
50 unsigned char max;
51 unsigned char min;
52 unsigned char min_replace;
53 unsigned char max_replace;
54};
55
56} // end namespace firevision
57
58#endif
Threshold filter.
Definition: threshold.h:35
void set_thresholds(unsigned char min, unsigned char min_replace, unsigned char max, unsigned char max_replace)
Set new thresholds.
Definition: threshold.cpp:79
virtual void apply()
Apply the filter.
Definition: threshold.cpp:91
FilterThreshold(unsigned char min=128, unsigned char min_replace=0, unsigned char max=127, unsigned char max_replace=255)
Constructor.
Definition: threshold.cpp:55
Filter interface.
Definition: filter.h:33