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

# Modules/ImageProcessor/SlamImageProcessor/SlamEdgeSpecialist.h

Go to the documentation of this file.

    00001 /**
    00002 * @file SlamEdgeSpecialist.h
    00003 *
    00004 * This file contains a class for Image Processing.
    00005 * @author Dirk Thomas
    00006 */
    00007
    00008 #ifndef __SlamEdgeSpecialist_h_
    00009 #define __SlamEdgeSpecialist_h_
    00010
    00011 #include "Representations/Perception/Image.h"
    00012 #include "Representations/Perception/LinesPercept.h"
    00013 #include "Representations/Perception/EdgesPercept.h"
    00014 #include "Tools/Math/Geometry.h"
    00015 #include "Tools/Math/Matrix2x2.h"
    00016
    00017 /**
    00018 The EdgeSpecialist finds a line- and border-edges in an image.
    00019 */
    00020 class SlamEdgeSpecialist
    00021 {
    00022 public:
    00023   SlamEdgeSpecialist();
    00024
    00025   /** reset all data before processing next frame. */
    00026   void reset();
    00027
    00028   /** reset before next scanline. */
    00029   void resetLine();
    00030
    00031   /** check point in camera-coordinates with given color on scanline if interesting changes. */
    00032   void checkPoint(
    00033     Vector2<int> point,
    00034     colorClass color,
    00035     const CameraMatrix& cameraMatrix,
    00036     const CameraMatrix& prevCameraMatrix,
    00037     const Image& image
    00038   );
    00039
    00040   /** add a point in camera-coordinates which is a candidate for an edge point. */
    00041   void addCandidate(
    00042     Vector2<int> point,
    00043     const Image& image
    00044   );
    00045
    00046   /** Searches for the edges based on the points and return edge-percepts from those. */
    00047   void getEdgesPercept(
    00048     EdgesPercept& percept,
    00049     const CameraMatrix& cameraMatrix,
    00050     const CameraMatrix& prevCameraMatrix,
    00051     const Image& image
    00052   );
    00053
    00054 private:
    00055   // used in checkPoint
    00056   bool greenBefore;
    00057   bool whiteBefore;
    00058   int numberOfContinuousNoColor;
    00059   Vector2<int> lastGreen, lastGreenField;
    00060   Vector2<int> lastWhite, lastWhiteField;
    00061
    00062   enum {maxNumberOfEdgePoints = 200};
    00063   struct EdgePoint
    00064   {
    00065     Vector2<int> offset;
    00066     Geometry::Line line;
    00067     int weight;
    00068     int belongsToLineNo;
    00069   };
    00070   EdgePoint edgePoints[maxNumberOfEdgePoints];
    00071   int numOfEdgePoints;
    00072   double gradientThreshold;
    00073   double normDistance;
    00074   double normProjection;
    00075   double multipleAverageDistance;
    00076   Matrix2x2<double> referenceChange;
    00077 };
    00078
    00079 #endif// __EdgeSpecialist_h_