Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef HoughAccumulator_H
00009 #define HoughAccumulator_H
00010
00011 #include "../KeyPointExtraction/KeyPointMatch.h"
00012 #include "Workers/Math/Point2D.h"
00013
00014 #include <vector>
00015 #include <list>
00016 #include <sstream>
00017 #include <opencv2/opencv.hpp>
00018
00024 class HoughAccumulator
00025 {
00026 public:
00027
00029 HoughAccumulator();
00030
00032 ~HoughAccumulator();
00033
00035 bool incrAccumulatorValue(int scaleIndex, int orientationIndex, int xIndex, int yIndex, KeyPointMatch match);
00036
00038 bool getAccumulatorValue(int scaleIndex, int orientationIndex, int xIndex, int yIndex, unsigned int& value);
00039
00041 void resetAccumulator();
00042
00044 std::vector< std::list< KeyPointMatch > > getClusteredMatches();
00045
00047 std::vector< std::list< KeyPointMatch > > getMaximumMatches();
00048
00050 void getImage( cv::Mat& target );
00051
00053 float getVariance();
00054
00055 std::string getLog(){return m_Log.str();}
00056
00057 private:
00058
00059
00060 struct compareMatchList
00061 {
00062 bool operator()(const std::list< KeyPointMatch>& a, const std::list< KeyPointMatch>& b )
00063 {
00064 return a.size() > b.size();
00065 }
00066 };
00067
00068 unsigned int getIndex(int scaleIndex, int orientationIndex, int xIndex, int yIndex);
00069 bool verifyAccumulatorIndex(int scale, int orientation, int xLocation, int yLocation);
00070 unsigned int getMaxAccumulatorValue();
00071
00072 int m_ScaleBins;
00073 int m_OrientationBins;
00074 int m_XLocationBins;
00075 int m_YLocationBins;
00076
00077 std::list< KeyPointMatch >* m_AccumulatorArray;
00078
00079 unsigned int m_AccumulatorSize;
00080
00081 std::ostringstream m_Log;
00082 };
00083
00084 #endif