00001 #ifndef LS_TRACKER
00002 #define LS_TRACKER
00003
00004 #include <vector>
00005 #include <image/Image.hpp>
00006 #include "lineSegmentSet.hpp"
00007 #include "matchingSet.hpp"
00008 #include "lsExtractor.hpp"
00009 namespace jafar{
00010 namespace lines{
00011
00013
00027 enum TrackScheme{
00028 GLOB_LOC_SEARCH,
00029 GLOB_MATCHING,
00030 GLOB_LOC_SEARCH_HISTOGRAMS
00031 };
00032
00034
00045 class LsTracker{
00046 public:
00047 LsTracker();
00048 ~LsTracker();
00049
00051
00064 void procTracking(jafar::image::Image* image, LineSegmentSet* oldLS, LineSegmentSet* newLS, jafar::lines::MatchingSet* match, bool globalExtrFlag=1, jafar::image::Image* colorImage=0, TrackScheme scheme=GLOB_LOC_SEARCH);
00065
00067
00082 void trackingScheme8(LineSegmentSet& lsA, LineSegmentSet& lsB, jafar::image::Image* image, jafar::image::Image* gradX, jafar::image::Image* gradY, jafar::lines::MatchingSet& match, jafar::image::Image* colorImage=0);
00083
00084
00086
00101 void trackingScheme7(LineSegmentSet& lsA, LineSegmentSet& lsB, jafar::image::Image* image, jafar::image::Image* gradX, jafar::image::Image* gradY, jafar::lines::MatchingSet& match, jafar::image::Image* colorImage=0);
00102
00104
00118 void trackingScheme6(LineSegmentSet& lsA, LineSegmentSet& lsB, jafar::image::Image* image, jafar::image::Image* gradX, jafar::image::Image* gradY, jafar::lines::MatchingSet& match, jafar::image::Image* colorImage=0);
00119
00121
00136 void trackingScheme5(LineSegmentSet& lsA, LineSegmentSet& lsB, jafar::image::Image* image, jafar::image::Image* gradX, jafar::image::Image* gradY, jafar::lines::MatchingSet& match, jafar::image::Image* colorImage=0);
00137
00139
00153 void trackingScheme4(LineSegmentSet& lsA, LineSegmentSet& lsB, jafar::image::Image* image, jafar::image::Image* gradX, jafar::image::Image* gradY, jafar::lines::MatchingSet& match, jafar::image::Image* colorImage=0);
00154
00156
00171 void trackingScheme3(LineSegmentSet& lsA, LineSegmentSet& lsB, jafar::image::Image* image, jafar::image::Image* gradX, jafar::image::Image* gradY, jafar::lines::MatchingSet& match, jafar::image::Image* colorImage=0);
00172
00174
00178 void trackingScheme2(LineSegmentSet& lsA, LineSegmentSet& lsB, jafar::image::Image* image, jafar::image::Image* gradX, jafar::image::Image* gradY, jafar::lines::MatchingSet& match);
00179
00181
00185 void trackingScheme1(LineSegmentSet& lsA, LineSegmentSet& lsB, jafar::image::Image* image, jafar::lines::MatchingSet& match);
00186
00187
00189
00192 void setCannyPara(int lowerThresh, int higherThresh, int ap){
00193 lsExtractor.setCannyPara(lowerThresh, higherThresh, ap);
00194 }
00195
00197
00200 void setNextId(uint _nextId){ nextId = _nextId;}
00201
00203
00208 void setMinLength(double _minLength, double _minLengthFitting=15){
00209 minLength = _minLength;
00210 minLengthFitting = _minLengthFitting;
00211 }
00212
00214
00217 void setHistoThresh(double thresh){histoThresh = thresh;}
00218
00219 private:
00220 jafar::image::Image* gradX;
00221 jafar::image::Image* gradY;
00222 jafar::image::Image* cannyIm;
00223
00224 jafar::lines::LsExtractor lsExtractor;
00225
00226 double minLength;
00227 double minLengthFitting;
00228 double histoThresh;
00229
00230 uint nextId;
00231
00232 };
00233 }
00234 }
00235 #endif