Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Modules/ImageProcessor/GT2005ImageProcessor/GT2005PlayerSpecialist.h

Go to the documentation of this file.

    00001 /**
    00002 * @file GT2005PlayerSpecialist.h
    00003 *
    00004 * This file contains a class for Image Processing.
    00005 * @author <A href=mailto:marc.dassler@web.de>Marc Dassler</A>
    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 * As part of the GridImageProcessor the GT2005FlagSpecialist searches for
    00024 * flag landmarks starting at a point in an Image determined before
    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   /** Execute the Specialist.*/
    00040   void execute();
    00041
    00042 private:
    00043   /**
    00044    * search for more robot properties
    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    * Finds the foot point of a robots leg. To compare the results the Y-axis is used
    00057    * @param start The starting point in the image
    00058    * @param depth count the step size. Used to make smaller steps in the foot near
    00059    * @return the foot point
    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    * Clusters the linespercepts in different robots
    00066    * Maximal 4 robots and 30 pixel space between them
    00067    */
    00068   void clusterRobotLinesPercepts();
    00069
    00070   /**
    00071    * Checks if the line between 2 points is mostly white or accepted color
    00072    */
    00073   bool checkForWhiteLineBetweenRed(Vector2<int> start, Vector2<int> stop);
    00074   bool checkForWhiteLineBetweenBlue(Vector2<int> start, Vector2<int> stop);
    00075   /**
    00076    * Inspect a color quad of the color proportion
    00077    */
    00078   inline colorClass inspectColorArea(const Vector2<unsigned char>& position, const Vector2<char>& direction);
    00079
    00080
    00081   Vector2<int> averageRedRobotSignatureStart[4], /** Needed for debugging */
    00082                averageRedRobotSignatureStop[4], /** Needed for debugging */
    00083                averageRedRobotSignature[4], /** Needed for debugging */
    00084                averageBlueRobotSignatureStart[4], /** Needed for debugging */
    00085                averageBlueRobotSignatureStop[4], /** Needed for debugging */
    00086                averageBlueRobotSignature[4]; /** Needed for debugging */
    00087
    00088
    00089   int clusteredRedRobots,clusteredBlueRobots; /** the number of clustered robots */
    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_