/
icEvolvedFilterModule.h
72 lines (50 loc) · 1.61 KB
/
icEvolvedFilterModule.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright: (C) 2011-2014 Juxi Leitner
// Author: Juxi Leitner <juxi.leitner@gmail.com>
// CopyPolicy: Released under the terms of the GNU GPL v2.0.
#ifndef _EVOLVEDFILTERMODULE_MODULE_H_
#define _EVOLVEDFILTERMODULE_MODULE_H_
#include "icFilterModule.h"
#include "boolList.h"
#include <yarp/os/Stamp.h>
using namespace yarp::os;
using namespace std;
using namespace yarp::sig;
class EvolvedFilterModule : public icFilterModule {
protected:
static const int MAX_TRIES = 5;
// the pointers to the images
IplImage* gray;
IplImage* red;
IplImage* green;
IplImage* blue;
IplImage* h;
IplImage* s;
IplImage* v;
// member vars
bool m_outOfSyncWarning;
int m_ImageWidth, m_ImageHeight;
std::string m_MoBeEObjectName; // "cup1"
// for evolved filter
boolList UsedInputs;
virtual void setUsedInputs();
std::vector<icImage*> InputImages;
void createInputImages(IplImage *in);
// move to something else ...
// void calculateAndSetObjectWorldPosition(CvPoint, CvPoint, CvPoint, CvPoint);
// void readEncoderPositions();
// output of position information over network
bool writePositionBottle(const CvPoint fp1, const CvPoint fp2, Stamp outTS);
// image memory containers for the buffered port
IplImage *rawImageToWrite, *outputImageToWrite;
bool checkTS(double TSLeft, double TSRight, double th=0.08);
public:
EvolvedFilterModule();
virtual ~EvolvedFilterModule();
bool updateModule();
virtual icImage* runFilter();
// already defined in icfilter ...
// bool respond (const yarp::os::Bottle& command, yarp::os::Bottle& reply);
bool interruptModule();
bool close ();
};
#endif