CrossRecognizer.H

Go to the documentation of this file.
00001 /*!@file SeaBee/CrossRecognizer.H find pipe     */
00002 // //////////////////////////////////////////////////////////////////// //
00003 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the //
00004 // University of Southern California (USC) and the iLab at USC.         //
00005 // See http://iLab.usc.edu for information about this project.          //
00006 // //////////////////////////////////////////////////////////////////// //
00007 // Major portions of the iLab Neuromorphic Vision Toolkit are protected //
00008 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency //
00009 // in Visual Environments, and Applications'' by Christof Koch and      //
00010 // Laurent Itti, California Institute of Technology, 2001 (patent       //
00011 // pending; application number 09/912,225 filed July 23, 2001; see      //
00012 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status).     //
00013 // //////////////////////////////////////////////////////////////////// //
00014 // This file is part of the iLab Neuromorphic Vision C++ Toolkit.       //
00015 //                                                                      //
00016 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can   //
00017 // redistribute it and/or modify it under the terms of the GNU General  //
00018 // Public License as published by the Free Software Foundation; either  //
00019 // version 2 of the License, or (at your option) any later version.     //
00020 //                                                                      //
00021 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope  //
00022 // that it will be useful, but WITHOUT ANY WARRANTY; without even the   //
00023 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
00024 // PURPOSE.  See the GNU General Public License for more details.       //
00025 //                                                                      //
00026 // You should have received a copy of the GNU General Public License    //
00027 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write   //
00028 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,   //
00029 // Boston, MA 02111-1307 USA.                                           //
00030 // //////////////////////////////////////////////////////////////////// //
00031 //
00032 // Primary maintainer for this file: Kevin Greene <kgreene@usc.edu>  && Eliezer Payzer <epayzer@usc.edu>
00033 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/SeaBee/CrossRecognizer.H $
00034 // $Id: CrossRecognizer.H 10794 2009-02-08 06:21:09Z itti $
00035 
00036 
00037 #ifndef CROSS_RECOGNIZER_DEFINED
00038 #define CROSS_RECOGNIZER_DEFINED
00039 
00040 #include "GUI/XWinManaged.H"
00041 #include "Image/Image.H"
00042 #include "Image/Pixels.H"
00043 #include "Util/Types.H"
00044 #include "Util/log.H"
00045 #include "Image/DrawOps.H"
00046 
00047 #include "MBARI/Geometry2D.H"
00048 #include "Image/OpenCVUtil.H"
00049 #include "Image/ColorOps.H"
00050 
00051 #define LINESCALE 80
00052 
00053 class CrossRecognizer
00054 {
00055 public:
00056 
00057   // ######################################################################
00058   //! @name Constructor, assigment and destructor
00059   //@{
00060 
00061   //! Constructor
00062   CrossRecognizer();
00063 
00064   //! Destructor
00065   ~CrossRecognizer();
00066 
00067   //@}
00068 
00069   // ######################################################################
00070   //! @name compute function
00071   //@{
00072 
00073   enum CrossRecognizeMethod { HOUGH, SOMETHING, SOMETHING_ELSE };
00074 
00075   //@}
00076 
00077   // ######################################################################
00078   //! @name compute function
00079   //@{
00080 
00081   void getCrossLocation       (rutz::shared_ptr<Image<byte> > colorSegmentedImage,
00082                                rutz::shared_ptr<Image<PixRGB <byte> > > outputImage,
00083                                CrossRecognizeMethod method,
00084                                rutz::shared_ptr<Point2D<int> > crossCenterPoint,
00085                                rutz::shared_ptr<float> crossAngle,
00086                                rutz::shared_ptr<uint> stalePointCount
00087                                );
00088   //@}
00089 
00090 private:
00091   void calculateHoughTransform(rutz::shared_ptr<Image<byte> > colorSegmentedImage,
00092                                rutz::shared_ptr<Image<PixRGB<byte> > > outputImage,
00093                                rutz::shared_ptr<Point2D<int> > crossCenterPoint,
00094                                rutz::shared_ptr<float> crossAngle,
00095                                rutz::shared_ptr<uint> stalePointCount
00096                                );
00097 
00098    Point2D<int> getCrossCenter(const std::vector<LineSegment2D> lines,
00099                                             std::vector<LineSegment2D> &centerPointLines,
00100                                             rutz::shared_ptr<uint> stalePointCount
00101                                             );
00102 
00103   std::vector<LineSegment2D> getHoughLines(rutz::shared_ptr< Image< byte > > colorSegmentedImage,
00104                                            rutz::shared_ptr< Image< PixRGB <byte> > > outputImage);
00105 
00106   std::vector<LineSegment2D> pruneLines (const std::vector<LineSegment2D> lineSegments);
00107 
00108   float getCrossDir(const std::vector<LineSegment2D> lines);
00109 
00110   std::list<Point2D<int> > centerPointBuff;
00111   std::list<float> angleBuff;
00112 
00113   int houghThreshold;               //!<
00114   int minThreshold;                 //!<
00115   int maxThreshold;
00116   float sigma;
00117   float tlow;
00118   float thigh;
00119   float linescale;
00120   int foundCount;
00121   int avgCrossCenterX;
00122   int avgCrossCenterY;
00123   float avgCrossAngle;
00124   float stdDevCrossX;
00125   float stdDevCrossY;
00126   float stdDevCrossAngle;
00127 
00128   uint stdDevAngleCount;
00129   uint stdDevCenterCount;
00130 
00131   bool itsSetupOrangeTracker;
00132 
00133 
00134 };
00135 
00136 #endif
00137 
00138 
00139 // ######################################################################
00140 /* So things look consistent in everyone's emacs... */
00141 /* Local Variables: */
00142 /* indent-tabs-mode: nil */
00143 /* End: */
Generated on Sun May 8 08:06:45 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3