00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __GT2005PlayerSpecialist_h_
00009 #define __GT2005PlayerSpecialist_h_
00010
00011 #include "Tools/Debugging/DebugImages.h"
00012
00013 #include "Representations/Perception/ColorTable.h"
00014 #include "Representations/Perception/CameraMatrix.h"
00015 #include "Representations/Perception/LinesPercept.h"
00016 #include "Representations/Perception/PlayersPercept.h"
00017 #include "Tools/Math/Geometry.h"
00018 #include "Modules/ImageProcessor/ImageProcessorTools/BresenhamLineScan.h"
00019 #include "Modules/ImageProcessor/ImageProcessorTools/ColorCorrector.h"
00020 #include "Modules/ImageProcessor/ImageProcessorTools/ImageProcessorUtilityClasses.h"
00021
00022
00023
00024
00025
00026 class GT2005PlayerSpecialist
00027 {
00028
00029 public:
00030 GT2005PlayerSpecialist(
00031 const ColorCorrector& colorCorrector,
00032 const ColorTable& colorTable,
00033 const Image& image,
00034 const ImageInfo& imageInfo,
00035 const LinesPercept& linesPercept,
00036 const CameraMatrix& cameraMatrix,
00037 PlayersPercept& playersPercept);
00038
00039
00040 void execute();
00041
00042 private:
00043
00044
00045
00046 void detectRedRobots(
00047 Vector2<int> averageRobotSignatureStart,
00048 Vector2<int> averageRobotSignatureStop,
00049 Vector2<int> averageRobotSignature);
00050 void detectBlueRobots(
00051 Vector2<int> averageRobotSignatureStart,
00052 Vector2<int> averageRobotSignatureStop,
00053 Vector2<int> averageRobotSignature);
00054
00055
00056
00057
00058
00059
00060
00061 Vector2<unsigned char> findRedFootPointYAxis(Vector2<unsigned char> start, Vector2<char> direction, short depth, unsigned char recursionLevel = 0);
00062 Vector2<unsigned char> findBlueFootPointYAxis(Vector2<unsigned char> start, Vector2<char> direction, short depth, unsigned char recursionLevel = 0);
00063
00064
00065
00066
00067
00068 void clusterRobotLinesPercepts();
00069
00070
00071
00072
00073 bool checkForWhiteLineBetweenRed(Vector2<int> start, Vector2<int> stop);
00074 bool checkForWhiteLineBetweenBlue(Vector2<int> start, Vector2<int> stop);
00075
00076
00077
00078 inline colorClass inspectColorArea(const Vector2<unsigned char>& position, const Vector2<char>& direction);
00079
00080
00081 Vector2<int> averageRedRobotSignatureStart[4],
00082 averageRedRobotSignatureStop[4],
00083 averageRedRobotSignature[4],
00084 averageBlueRobotSignatureStart[4],
00085 averageBlueRobotSignatureStop[4],
00086 averageBlueRobotSignature[4];
00087
00088
00089 int clusteredRedRobots,clusteredBlueRobots;
00090 int averageRedRobotSignaturePoints[4],
00091 averageBlueRobotSignaturePoints[4];
00092
00093 int maxDepth;
00094
00095 const ImageInfo& imageInfo;
00096 const ColorTable& colorTable;
00097 const ColorCorrector& colorCorrector;
00098 const LinesPercept& linesPercept;
00099 const Image& image;
00100 const CameraMatrix& cameraMatrix;
00101
00102 PlayersPercept& playersPercept;
00103
00104 };
00105
00106
00107 #endif// __GT2005PlayerSpecialist_h_