00001
00002
00003 #ifndef _DIRECT_SEGMENTS_TRACKER_HPP_
00004 #define _DIRECT_SEGMENTS_TRACKER_HPP_
00005
00006 #include <dseg/DirectSegmentsBase.hpp>
00007
00008 namespace jafar {
00009 namespace dseg {
00010 class Predictor;
00011 class GradientStatsDescriptor;
00012 struct GrowSegmentContext;
00018 class DirectSegmentsTracker : public DirectSegmentsBase {
00019 public:
00020 DirectSegmentsTracker();
00021 virtual ~DirectSegmentsTracker();
00029 void trackSegment( const jafar::image::Image& _image, const SegmentsSet& _initialSegments, const Predictor* _predictor, SegmentsSet& _segmentStorage );
00030 void trackSegment( PreprocessedImage& _image, const SegmentsSet& _initialSegments, const Predictor* _predictor, SegmentsSet& _segmentStorage );
00031
00032 void preprocessImage(const jafar::image::Image& _image, PreprocessedImage& preproc);
00033
00034 public:
00038 JFR_DEFINE_PARAM_RW( bool, adjustPrediction, setAdjustPrediction)
00039 private:
00040 bool findInitialGuesses( GrowSegmentContext& _gsc, const GradientStatsDescriptor& _gradientDescriptor, double _tMin, double _tMax, double& _x0, double& _y0, double& _angle ) const;
00041 bool findInitialGuess( GrowSegmentContext& _gsc, const GradientStatsDescriptor& _gradientDescriptor, double _t, double& _x0, double& _y0, double& _angle, double & _step ) const;
00042 };
00043 }
00044 }
00045
00046 #endif