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
/**
* @file GoalFeatureDetectorV2.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 GoalFeatureDetectorV2
*/

#ifndef _GoalFeatureDetectorV2_H_
#define _GoalFeatureDetectorV2_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 "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(GoalFeatureDetectorV2)
  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(GoalFeatureDetectorV2)


class GoalFeatureDetectorV2: private GoalFeatureDetectorV2Base
{
public:

  GoalFeatureDetectorV2();
  virtual ~GoalFeatureDetectorV2();

  // override the Module execute method
  bool execute(CameraInfo::CameraID id);

  virtual void execute()
  {
    execute(CameraInfo::Top);

    // HACK: RC15 don't check for goals in the bottom camera
    //execute(CameraInfo::Bottom);
  }

private:
  static const int imageBorderOffset = 5;
  CameraInfo::CameraID cameraID;

  class Parameters: public ParameterList
  {
  public:
    Parameters() : ParameterList("GoalFeatureV2Parameters")<--- Member variable 'Parameters::experimental' is not initialized in the constructor.
    {
      PARAMETER_REGISTER(numberOfScanlines) = 9;
      PARAMETER_REGISTER(scanlinesDistance) = 8;

      //PARAMETER_REGISTER(detectWhiteGoals) = true;
      PARAMETER_REGISTER(threshold) = 140;
      PARAMETER_REGISTER(thresholdGradient) = 7;
      PARAMETER_REGISTER(thresholdFeatureGradient) = 0.5;
      PARAMETER_REGISTER(maxFeatureWidth) = 213;

      syncWithConfig();
    }

    virtual ~Parameters() {
    }

    int numberOfScanlines;
    int scanlinesDistance;

    //bool detectWhiteGoals;
    //bool usePrewitt;
    //bool useColorFeatures;
    bool experimental;
    int threshold;
    int thresholdGradient;
    int maxFeatureWidth;

    double thresholdFeatureGradient;
  };

  Parameters params;

  void findEdgelFeatures(const Vector2d& scanDir, const Vector2i& p1);<--- Function 'findEdgelFeatures' argument 2 names different: declaration 'p1' definition 'start'.
  Vector2d calculateGradientUV(const Vector2i& point) const;
  Vector2d calculateGradientY(const Vector2i& point) const;

  DOUBLE_CAM_PROVIDE(GoalFeatureDetectorV2, DebugImageDrawings);

  // double cam stuff
  DOUBLE_CAM_REQUIRE(GoalFeatureDetectorV2, Image);
  DOUBLE_CAM_REQUIRE(GoalFeatureDetectorV2, ArtificialHorizon);

  DOUBLE_CAM_PROVIDE(GoalFeatureDetectorV2, GoalFeaturePercept);

};//end class GoalFeatureDetectorV2

#endif // _GoalFeatureDetectorV2_H_