00001 /*!@file BeoSub/BeoSubPipe.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/BeoSubPipe.H $ 00034 // $Id: BeoSubPipe.H 8748 2007-09-06 06:33:19Z rjpeters $ 00035 00036 00037 #ifndef BEOSUB_BEOSUBPIPE_DEFINED 00038 #define BEOSUB_BEOSUBPIPE_DEFINED 00039 00040 #include "GUI/XWinManaged.H" 00041 #include "Image/Image.H" 00042 #include "MBARI/Geometry2D.H" 00043 00044 #include <list> 00045 00046 //END CAMERA STUFF 00047 00048 //canny 00049 #define BOOSTBLURFACTOR 90.0 00050 #define FREE_ARG char* 00051 #define FILLBLEED 4 00052 #define INITIAL_TEMPERATURE 30.0 00053 #define FINAL_TEMPERATURE 0.5 00054 #define ALPHA 0.98 00055 #define STEPS_PER_CHANGE 1000 00056 #define BIN_ANGLE 0.588001425 00057 00058 00059 class BeoSubPipe 00060 { 00061 public: 00062 00063 // ###################################################################### 00064 //! @name Constructor, assigment and destructor 00065 //@{ 00066 00067 //! Constructor 00068 BeoSubPipe(); 00069 00070 //! Destructor 00071 ~BeoSubPipe(); 00072 00073 //@} 00074 00075 // ###################################################################### 00076 //! @name Compute functions 00077 //@{ 00078 00079 float pipeOrientation 00080 (Image< PixRGB <byte> > &cameraImage, 00081 Image<PixRGB <byte> > &outputImg); 00082 00083 float getPipeDir 00084 (const std::vector<LineSegment2D> lines, 00085 const float thresh, 00086 uint &totaladjustedlinecount); 00087 00088 std::vector<LineSegment2D> getPipes 00089 (const std::vector<LineSegment2D> lines 00090 ); 00091 00092 std::vector<LineSegment2D> getHoughLines (Image<byte> &image, 00093 Image< PixRGB<byte> > &outputImage); 00094 //@} 00095 00096 private: 00097 00098 int houghThreshold; //!< 00099 int minThreshold; //!< 00100 int maxThreshold; 00101 float sigma; 00102 float tlow; 00103 float thigh; 00104 float linescale; 00105 int foundCount; 00106 uint fNum; 00107 00108 std::list<float> angleBuff; 00109 00110 float avgPipeAngle; 00111 float stdDevPipeAngle; 00112 00113 uint stdDevAngleCount; 00114 00115 //! window to display results 00116 rutz::shared_ptr<XWinManaged> itsWin; 00117 bool itsWinInitialized; 00118 }; 00119 00120 #endif 00121 00122 00123 // ###################################################################### 00124 /* So things look consistent in everyone's emacs... */ 00125 /* Local Variables: */ 00126 /* indent-tabs-mode: nil */ 00127 /* End: */