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

# Modules/ImageProcessor/GT2005ImageProcessor/GuideDogRobotSpecialist.h

Go to the documentation of this file.

    00001 /**
    00002 * @file GuideDogRobotSpecialist.h
    00003 *
    00004 * Definition of class GuideDogRobotSpecialist.
    00005 * Detects (ok, it'd be nice if it did) red robots in an image.
    00006 */
    00007
    00008 #ifndef GuideDogRobotSpecialist_h_
    00009 #define GuideDogRobotSpecialist_h_
    00010
    00011 #include "Modules/ImageProcessor/ImageProcessorTools/ColorCorrector.h"
    00012
    00013 /**
    00014 * @class GuideDogRobotSpecialist
    00015 */
    00016 class GuideDogRobotSpecialist
    00017 {
    00018 public:
    00019 private:
    00020   /** A reference to the image that is scanned for a goal */
    00021   const Image& image;
    00022
    00023   /** A reference to the camera matrix that describes position and rotation of the camera when the image was aquired */
    00024   const CameraMatrix& cameraMatrix;
    00025
    00026   /** A reference to the previous camera matrix that describes position and rotation of the camera when the image was aquired */
    00027   const CameraMatrix& prevCameraMatrix;
    00028
    00029   /** A reference to the color table */
    00030   const ColorTable& colorTable;
    00031
    00032   /** A reference to the singeplayer percept */
    00033   PlayersPercept& playersPercept;
    00034
    00035   /** A reference to the color corrector */
    00036   const ColorCorrector& colorCorrector;
    00037
    00038   /** A representation of the horizon */
    00039   Geometry::Line horizonLine, verticalLine;
    00040
    00041   /** The number of horizontal scan lines */
    00042   int numberOfHorizontalScanLines;
    00043
    00044   static const int maxNumberOfHorizontalScanLines = 32;
    00045
    00046   /** representation of the left points of the horizontal scan lines */
    00047   Vector2<int> leftPoint[maxNumberOfHorizontalScanLines];
    00048
    00049   /** representation of the right points of the horizontal scan lines */
    00050   Vector2<int> rightPoint[maxNumberOfHorizontalScanLines];
    00051
    00052 public:
    00053   GuideDogRobotSpecialist(
    00054     const Image& image,
    00055     const CameraMatrix& cameraMatrix,
    00056     const CameraMatrix& prevCameraMatrix,
    00057     const ColorTable& colorTable,
    00058     const ColorCorrector& colorCorrector,
    00059     PlayersPercept& playersPercept
    00060     );
    00061
    00062   ~GuideDogRobotSpecialist();
    00063
    00064   void execute();
    00065
    00066 private:
    00067   void calculateScanLinesParallelToHorizon();
    00068   void scanParallelToHorizon();
    00069   bool inline isRed(int x, int y);
    00070 };
    00071
    00072 #endif // GuideDogRobotSpecialist