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

Modules/ImageProcessor/GT2004ImageProcessor/GT2004EdgeSpecialist.h

Go to the documentation of this file.
00001 /**
00002 * @file GT2004EdgeSpecialist.h
00003 * 
00004 * This file contains a class for Image Processing.
00005 * @author Dirk Thomas
00006 */
00007 
00008 #ifndef __GT2004EdgeSpecialist_h_
00009 #define __GT2004EdgeSpecialist_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 GT2004EdgeSpecialist  
00021 {
00022 public:
00023   GT2004EdgeSpecialist();
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_
00080 
00081 /*
00082 * $Log: GT2004EdgeSpecialist.h,v $
00083 * Revision 1.4  2004/06/21 16:15:59  nistico
00084 * Now mathematically correct
00085 *
00086 * Revision 1.3  2004/06/16 13:39:14  thomas
00087 * update edge-specialist
00088 *
00089 * Revision 1.2  2004/06/15 10:58:26  thomas
00090 * added edge-specialist, edges-percept, debug-drawings etc. (not yet called from image-processor)
00091 *
00092 * Revision 1.1  2004/05/26 20:21:08  thomas
00093 * added empty class edge-specialist
00094 *
00095 */

Generated on Thu Sep 23 19:57:28 2004 for GT2004 by doxygen 1.3.6