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

Modules/ImageProcessor/ImageProcessorTools/ImageProcessorUtilityClasses.h

Go to the documentation of this file.
00001 
00002 #ifndef __ImageProcessorUtilityClasses_h_
00003 #define __ImageProcessorUtilityClasses_h_
00004 
00005 
00006 #include "Tools/Math/Vector2.h"
00007 #include "Tools/Math/Matrix2x2.h"
00008 
00009 /**
00010 * @class ImageInfo
00011 *
00012 * Additional information about the current image,
00013 * computed by the ImageProcessor
00014 */
00015 class ImageInfo
00016 {
00017 public:
00018   /** The horizon*/
00019   Geometry::Line horizon;
00020   /** A line perpendicular to the horizon*/
00021   Geometry::Line vertLine;
00022   /** Flag, indicates whether the horizon is in the image or not*/
00023   bool horizonInImage;
00024   /** The starting point of the horizon*/
00025   Vector2<int> horizonStart;
00026   /** The end point of the horizon*/
00027   Vector2<int> horizonEnd;
00028   /** The bottom right corner of the image*/
00029   Vector2<int> maxImageCoordinates;
00030 };
00031 
00032 
00033 /**
00034 * @class Run
00035 *
00036 * Describes a sequence of pixels of the same colour
00037 */
00038 class Run
00039 {
00040 public:
00041   /** Constructor*/
00042   Run():length(0) {}
00043 
00044   /** The first point*/
00045   Vector2<int> start;
00046   /** The last point*/
00047   Vector2<int> end;
00048   /** The first point of the corresponding scan line*/
00049   Vector2<int> scanLineStart;
00050   /** The length of the run*/
00051   int length;
00052   /** The color*/
00053   colorClass color;
00054 };
00055 
00056 
00057 /**
00058 * @class TransformedRun
00059 *
00060 * Special class for comparing and clustering runs
00061 */
00062 class TransformedRun
00063 {
00064 public:
00065   /** Computes values
00066   * @param run An original run
00067   * @param rotMat The rotation matrix
00068   * @param numOfRun The number of the transformed run
00069   */
00070   void transform(const Run& run, const Matrix2x2<double>& rotMat, int numOfRun)
00071   {
00072     start.x = (double)(run.start.x - run.scanLineStart.x);
00073     start.y = (double)(run.start.y - run.scanLineStart.y);
00074     end.x = (double)(run.end.x - run.scanLineStart.x);
00075     end.y = (double)(run.end.y - run.scanLineStart.y);
00076     start = (rotMat*start);
00077     end = (rotMat*end);
00078     start.x += (double)run.scanLineStart.x;
00079     start.y += (double)run.scanLineStart.y;
00080     end.x += (double)run.scanLineStart.x;
00081     end.y += (double)run.scanLineStart.y;
00082     this->numOfRun = numOfRun;
00083   }
00084 
00085   /** The first point*/
00086   Vector2<double> start;
00087   /** The last point*/
00088   Vector2<double> end;
00089   /** Number of corresponding real run*/
00090   int numOfRun;
00091 };
00092 
00093 
00094 #endif
00095 
00096 /*
00097  *
00098  * $Log: ImageProcessorUtilityClasses.h,v $
00099  * Revision 1.2  2004/09/08 14:39:02  wachter
00100  * - Fixed some doxygen-errors
00101  *
00102  *
00103  */

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