00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef HOUGH_TRANSFORM_H
00013 #define HOUGH_TRANSFORM_H
00014
00015 #include <boost/numeric/ublas/vector.hpp>
00016 #include <boost/shared_ptr.hpp>
00017 #include "object.h"
00018 #include "image.h"
00019 #include "line.h"
00020 #include "angle.h"
00021
00022 namespace mimas {
00029 class hough_transform : public image<double>
00030 {
00031 private:
00032 int calcGaussBoxSize( double sigma, double accuracy );
00033
00034
00035
00036 boost::shared_ptr< image< double > > bell_curve;
00037
00038 public:
00039 typedef boost::numeric::ublas::vector< double > Vector;
00040 typedef boost::numeric::ublas::vector< int > IntVector;
00041 hough_transform(void)
00042 {
00043
00044
00045
00046 }
00047
00048
00049 void addGaussPoint( const IntVector &posn, double weight, double sigma, double precision );
00050 void addGaussLine( line line, double weight, double sigma, double precision );
00051 void addSlopedGaussLine( line line, double weight, double sigma, double precision );
00052 bool lineHitsPoint( const IntVector &point, line line, double sigma, double precision );
00053 void makeAngleEntry(angle a, double sigma, double prec );
00054 void normalize(void);
00055 angle getAngle( void );
00056
00057 void initFastGauss( double sigma, double precision );
00058 void addGaussPointFast( const IntVector &posn );
00059 void addGaussLineFast( line line, double weight );
00060 };
00061
00062 };
00063
00064 #endif
00065