00001 /* 00002 * Copyright (C) Gostai S.A.S., 2007. All rights reserved. 00003 * 00004 * This software is provided "as is" without warranty of any kind, 00005 * either expressed or implied, including but not limited to the 00006 * implied warranties of fitness for a particular purpose. 00007 * 00008 * See the LICENSE file for more information. 00009 * For comments, bug reports and feedback: http://www.urbiforge.com 00010 */ 00011 #ifndef HOUGHLINES_HH_ 00012 #define HOUGHLINES_HH_ 00013 00014 #include <iostream> 00015 #include <cv.h> 00016 #include <cxcore.h> 00017 #include <highgui.h> 00018 #include <math.h> 00019 #include "visionbehavior.hpp" 00020 00021 #define DST 150 00022 #define SQUARE_DST DST * DST 00023 #define HACK_HEIGHT 80 00024 00029 class HoughLines : public VisionBehavior<CvSeq> { 00030 private: 00031 CvSeq* result; 00032 CvMemStorage* storage; 00033 bool hack; 00034 public: 00035 HoughLines(bool hack = false); 00036 virtual ~HoughLines(); 00037 virtual void writeOn(IplImage& img) const; 00038 virtual CvSeq& getResult(); 00039 void setHack(bool); 00040 private: 00041 virtual void compute(const IplImage& img); 00042 virtual void emptyResult(); 00043 void workOnLines(); 00044 void freeItems(); 00045 }; 00046 00047 #endif /* !HOUGHLINES_HH_ */