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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 | /**
* @file GoalFeatureDetector.h
*
* @author <a href="mailto:mellmann@informatik.hu-berlin.de">Heinrich Mellmann</a>
* @author <a href="mailto:critter@informatik.hu-berlin.de">CNR</a>
* Definition of class GoalFeatureDetector
*/
#ifndef _GoalFeatureDetector_H_
#define _GoalFeatureDetector_H_
#include <ModuleFramework/Module.h>
//#include <Representations/Infrastructure/FrameInfo.h>
#include <Representations/Infrastructure/Image.h>
#include "Representations/Perception/ArtificialHorizon.h"
#include "Representations/Perception/GoalFeaturePercept.h"
// tools
#include "Tools/DoubleCamHelpers.h"
#include <Tools/DataStructures/RingBuffer.h>
#include <Tools/DataStructures/RingBufferWithSum.h>
//#include "Tools/naoth_opencv.h"
#include "Tools/ImageProcessing/Edgel.h"
#include "Tools/ImageProcessing/Filter.h"
#include "Tools/ImageProcessing/MaximumScan.h"
#include "Representations/Debug/Stopwatch.h"
#include "Tools/Debug/DebugRequest.h"
#include "Tools/Debug/DebugModify.h"
#include "Tools/Debug/DebugImageDrawings.h"
#include "Tools/Debug/DebugParameterList.h"
BEGIN_DECLARE_MODULE(GoalFeatureDetector)
PROVIDE(StopwatchManager)
PROVIDE(DebugRequest)
PROVIDE(DebugModify)
PROVIDE(DebugImageDrawings)
PROVIDE(DebugImageDrawingsTop)
PROVIDE(DebugParameterList)
REQUIRE(Image)
REQUIRE(ImageTop)
REQUIRE(ArtificialHorizon)
REQUIRE(ArtificialHorizonTop)
PROVIDE(GoalFeaturePercept)
PROVIDE(GoalFeaturePerceptTop)
END_DECLARE_MODULE(GoalFeatureDetector)
class GoalFeatureDetector: private GoalFeatureDetectorBase
{
public:
GoalFeatureDetector();
virtual ~GoalFeatureDetector();
// override the Module execute method
bool execute(CameraInfo::CameraID id);
virtual void execute()
{
execute(CameraInfo::Top);
execute(CameraInfo::Bottom);
}
private:
static const int imageBorderOffset = 5;
CameraInfo::CameraID cameraID;
class Parameters: public ParameterList
{
public:
Parameters() : ParameterList("GoalFeatureParameters")<--- Member variable 'Parameters::usePrewitt' is not initialized in the constructor.
{
PARAMETER_REGISTER(numberOfScanlines) = 9;
PARAMETER_REGISTER(scanlinesDistance) = 8;
PARAMETER_REGISTER(detectWhiteGoals) = true;
PARAMETER_REGISTER(useColorFeatures) = true;
PARAMETER_REGISTER(threshold) = 140;
PARAMETER_REGISTER(thresholdGradient) = 30;
PARAMETER_REGISTER(thresholdFeatureGradient) = 0.8;
PARAMETER_REGISTER(maxFeatureWidth) = 213;
syncWithConfig();
}
virtual ~Parameters() {
}
int numberOfScanlines;
int scanlinesDistance;
bool detectWhiteGoals;
bool usePrewitt;
bool useColorFeatures;
int threshold;
int thresholdGradient;
int maxFeatureWidth;
double thresholdFeatureGradient;
};
private:
Parameters params;
void findfeaturesColor(const Vector2d& scanDir, const Vector2i& p1);<--- Function 'findfeaturesColor' argument 2 names different: declaration 'p1' definition 'start'.
void findfeaturesDiff(const Vector2d& scanDir, const Vector2i& p1);<--- Function 'findfeaturesDiff' argument 2 names different: declaration 'p1' definition 'start'.
Vector2d calculateGradientUV(const Vector2i& point) const;
Vector2d calculateGradientY(const Vector2i& point) const;
private:
DOUBLE_CAM_PROVIDE(GoalFeatureDetector, DebugImageDrawings);
// double cam stuff
DOUBLE_CAM_REQUIRE(GoalFeatureDetector, Image);
DOUBLE_CAM_REQUIRE(GoalFeatureDetector, ArtificialHorizon);
DOUBLE_CAM_PROVIDE(GoalFeatureDetector, GoalFeaturePercept);
};//end class GoalFeatureDetector
#endif // _GoalFeatureDetector_H_
|