Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

VideoSeg.h

00001 /*
00002  *  Video Segmentation
00003  *
00004  *  Copyright (c) 2000, TNO TPD, The Netherlands.
00005  *  All rights reserved. No part of this software may be handed to or used by persons 
00006  *  or organisation outside Kenniscentrum Watergraafsmeer (UvA-ISIS, TNO TPD) without 
00007  *  the written permission of TNO TPD.
00008  *
00009  *  Author(s):
00010  *      Jan Baan (baan@tpd.tno.nl)
00011  *
00012  */
00013 
00014 
00015 
00016 #ifndef VideoSeg_h
00017 #define VideoSeg_h
00018 
00019 #include "HxImageSeq.h"
00020 #include "BaseClass.h"
00021 #include "vector"
00022 #include "HxException.h"
00023 #include "CounterConstDestr.h"
00024 #include "VxSegmentList.h"
00025 
00026 #define DEFAULT_CTlengthSlidWind 3 //5
00027 //#define DEFAULT_CTproportion 3 //2.5    
00028 #define DEFAULT_CTproportion 1.73 // sqrt(3)    
00029 //#define DEFAULT_CTthreshold 0.1 // 0.2
00030 #define DEFAULT_CTthreshold 0.32 // sqrt(0.1)
00031 #define DEFAULT_FrameDiffOverlap 10
00032 
00033 #define DEFAULT_frameDiffNumDeltaF 6 // Delta F = [1 2 4 8 ...]
00034 
00035 //#define DEFAULT_TRthreshold 0.7 //0.8
00036 #define DEFAULT_TRthreshold 0.84 //sqrt(0.7)
00037 //#define DEFAULT_TRthreshold2 0.4
00038 #define DEFAULT_TRthreshold2 0.63 // sqrt(0.4)
00039 #define DEFAULT_TRmaxDivMax 2
00040 #define DEFAULT_TRdeltaF 4
00041 
00042 #define numberOfHistogramValues 64 //256
00043 
00044 
00045 //#define frameWidth FrameWidth
00046 //#define frameHeight FrameHeight
00047 #define doubl double
00048 //#define nrFrames NumOfFrames
00049 
00050 class VideoSeg : public BaseClass, public CounterConstDestr<VideoSeg>
00051 {
00052     public:
00053         //VideoSeg() {}
00054 
00055         VideoSeg(const char *filename);
00056 
00057         VideoSeg(const HxImageSeq _Seq);
00058 
00059         ~VideoSeg() { };
00060 
00061         VxSegmentList           ToVxSegmentList();
00062 
00064         void FindCut(const int CTlengthSlidWind     = DEFAULT_CTlengthSlidWind, 
00065             const double CTproportion               = DEFAULT_CTproportion, 
00066             const double CTthreshold                = DEFAULT_CTthreshold);
00067         int GetNumberOfCuts() const;
00068         int GetCuts(const int index) const;
00069 
00070         
00072         void FindTrans(const double TRthreshold     = DEFAULT_TRthreshold, 
00073             const double TRthreshold2               = DEFAULT_TRthreshold2, 
00074             const int TRdeltaF                      = DEFAULT_TRdeltaF, 
00075             const double TRmaxDivMax                = DEFAULT_TRmaxDivMax);
00076         int GetNumberOfTrans() const;
00077         int GetTrans(const int index) const;
00078         int GetTransLength(const int index) const;
00079 
00080 
00087         void SaveFrameDiff(const char *filename) const; 
00088         void LoadFrameDiff(const char *filename); 
00089         
00091         void CalcFrameDiffGray();
00092 
00093     private:
00094         void Init();
00095 
00096         HxImageSeq seq;
00097         
00098         int frameDiffNumDeltaF;
00099         std::vector<double> frameDiff;
00100 
00101         double GetFrameDiff(const int frame, const int deltaF=0) const;
00102         void CalcFrameDiff();
00103         bool isCalcFrameDiff;
00104 
00105         void SanityCheck() const;
00106 
00108         std::vector<int> CTindex;
00109         bool CTisProcessed;
00110         
00112         std::vector<int> TRindex;
00113         std::vector<int> TRlength;
00114         bool TRisProcessed;
00115         
00116         
00117 };
00118 
00119 
00120 #endif

Generated on Tue Jan 8 13:59:18 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001