BeoSubCross.H

00001 /*!@file BeoSub/BeoSubCross.C 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: Michael Montalbo <montalbo@usc.edu>
00033 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/BeoSub/BeoSubCross.H $
00034 // $Id: BeoSubCross.H 9412 2008-03-10 23:10:15Z farhan $
00035 
00036 
00037 #ifndef BEOSUB_BEOSUBCROSS_DEFINED
00038 #define BEOSUB_BEOSUBCROSS_DEFINED
00039 
00040 #include "GUI/XWinManaged.H"
00041 #include "Image/Image.H"
00042 #include "MBARI/Geometry2D.H"
00043 #include "VFAT/segmentImageTrackMC.H"
00044 
00045 #include <list>
00046 
00047 //#include <queue>
00048 //END CAMERA STUFF
00049 
00050 //canny
00051 #define BOOSTBLURFACTOR 90.0
00052 #define FREE_ARG char*
00053 #define FILLBLEED 4
00054 #define INITIAL_TEMPERATURE 30.0
00055 #define FINAL_TEMPERATURE 0.5
00056 #define ALPHA 0.98
00057 #define STEPS_PER_CHANGE 1000
00058 #define BIN_ANGLE 0.588001425
00059 
00060 
00061 class BeoSubCross
00062 {
00063 public:
00064 
00065   // ######################################################################
00066   //! @name Constructor, assigment and destructor
00067   //@{
00068 
00069   //! Constructor
00070   BeoSubCross();
00071 
00072   //! Destructor
00073   ~BeoSubCross();
00074 
00075   //@}
00076 
00077   // ######################################################################
00078   //! @name Compute functions
00079   //@{
00080 
00081   void setupOrangeTracker();
00082 
00083   int getOrangeMass(Image< PixRGB<byte> > image,
00084                     Image< PixRGB<byte> >& display);
00085 
00086   std::vector<LineSegment2D> pruneLines(std::vector<LineSegment2D> lines);
00087 
00088   std::vector<LineSegment2D> getHoughLines  (Image< PixRGB<byte> > &image,
00089                                              Image< PixRGB<byte> > &outputImage);
00090 
00091   float getCrossDir  (const std::vector<LineSegment2D> lines);
00092 
00093   Point2D<int> getCrossCenter  (const std::vector<LineSegment2D> lines,
00094                            std::vector<LineSegment2D>& centerPointLines,
00095                            uint &stalePointCount);
00096   //@}
00097 
00098   segmentImageTrackMC<float,unsigned int,4> *segmenter;
00099 
00100   readConfig colorConf;
00101 
00102   std::vector<float> color;
00103   std::vector<float> norm;
00104   std::vector<float> std;
00105   std::vector<float> adapt;
00106   std::vector<float> upperBound;
00107   std::vector<float> lowerBound;
00108 
00109 private:
00110 
00111   std::list<Point2D<int> > centerPointBuff;
00112   std::list<float> angleBuff;
00113 
00114   int houghThreshold;               //!<
00115   int minThreshold;                 //!<
00116   int maxThreshold;
00117   float sigma;
00118   float tlow;
00119   float thigh;
00120   float linescale;
00121   int foundCount;
00122   int avgCrossCenterX;
00123   int avgCrossCenterY;
00124   float avgCrossAngle;
00125   float stdDevCrossX;
00126   float stdDevCrossY;
00127   float stdDevCrossAngle;
00128 
00129   uint stdDevAngleCount;
00130   uint stdDevCenterCount;
00131 
00132   bool itsSetupOrangeTracker;
00133 };
00134 
00135 #endif
00136 
00137 
00138 // ######################################################################
00139 /* So things look consistent in everyone's emacs... */
00140 /* Local Variables: */
00141 /* indent-tabs-mode: nil */
00142 /* End: */
Generated on Sun May 8 08:40:19 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3