Update the trunk to the OpenCV's CVS (2008-07-14)
[opencv] / cvaux / include / cvvidsurv.hpp
index 9f31ef5..8e49210 100644 (file)
@@ -43,7 +43,7 @@
 #ifndef __CVVIDEOSURVEILLANCE_H__
 #define __CVVIDEOSURVEILLANCE_H__
 
-/* turn off the functionality until cvaux/src/Makefile.am gets updated */
+/* Turn off the functionality until cvaux/src/Makefile.am gets updated: */
 //#if _MSC_VER >= 1200
 
 #include <stdio.h>
@@ -76,14 +76,14 @@ struct CvDefParam
 
 class CV_EXPORTS CvVSModule
 {
-private: /* internal data */
+private: /* Internal data: */
     CvDefParam*   m_pParamList;
     char*       m_pModuleTypeName;
     char*       m_pModuleName;
     char*       m_pNickName;
 protected:
     int         m_Wnd;
-public: /* constructor and destructor */
+public: /* Constructor and destructor: */
     CvVSModule()
     {
         m_pNickName = NULL;
@@ -106,7 +106,7 @@ public: /* constructor and destructor */
         if(m_pModuleTypeName)free(m_pModuleTypeName);
         if(m_pModuleName)free(m_pModuleName);
     }
-private: /* internal functions */
+private: /* Internal functions: */
     void    FreeParam(CvDefParam** pp)
     {
         CvDefParam* p = pp[0];
@@ -254,7 +254,7 @@ public: /* EXTERNAL INTERFACE */
     void   SetParamStr(char* name, char* str)
     {
         CvDefParam* p = m_pParamList;
-        for(;p;p=p->next)
+        for(; p; p=p->next)
         {
             if(cv_stricmp(p->pName,name) != 0) continue;
             if(p->pStr)
@@ -265,8 +265,8 @@ public: /* EXTERNAL INTERFACE */
                 p->pStr[0] = p->Str;
             }
         }
-        /* convert to double and set */
-        if(str)SetParam(name,atof(str));
+        /* Convert to double and set: */
+        if(str) SetParam(name,atof(str));
     }
     void TransferParamsFromChild(CvVSModule* pM, char* prefix = NULL)
     {
@@ -336,7 +336,7 @@ public: /* EXTERNAL INTERFACE */
                 else
                     pM->SetParam(N,GetParam(tmp));
             }
-        }/* transfer next param */
+        }/* Transfer next parameter */
         pM->ParamUpdate();
     }/* Transfer params */
 
@@ -359,10 +359,11 @@ public: /* EXTERNAL INTERFACE */
     }
     void SetNickName(char* pStr)
     {
-
         if(m_pNickName)
             free(m_pNickName);
+
         m_pNickName = NULL;
+
         if(pStr)
             m_pNickName = strdup(pStr);
     }
@@ -407,9 +408,9 @@ class CV_EXPORTS CvFGDetector: public CvVSModule
 {
 public:
     virtual IplImage* GetMask() = 0;
-    /* process current image */
+    /* Process current image: */
     virtual void    Process(IplImage* pImg) = 0;
-    /* release foreground detector */
+    /* Release foreground detector: */
     virtual void    Release() = 0;
 };
 inline void cvReleaseFGDetector(CvFGDetector** ppT )
@@ -427,7 +428,7 @@ struct CvBlob
 {
     float   x,y; /* blob position   */
     float   w,h; /* blob sizes      */
-    int     ID;  /* blbo ID         */     
+    int     ID;  /* blob ID         */     
 };
 
 inline CvBlob cvBlob(float x,float y, float w, float h)
@@ -470,7 +471,7 @@ public:
     virtual CvBlob* GetBlobByID(int BlobID)
     {
         int i;
-        for(i=0;i<m_pSeq->total;++i)
+        for(i=0; i<m_pSeq->total; ++i)
             if(BlobID == CV_BLOB_ID(GetBlob(i)))
                 return GetBlob(i);
         return NULL;
@@ -482,7 +483,7 @@ public:
     virtual void DelBlobByID(int BlobID)
     {
         int i;
-        for(i=0;i<m_pSeq->total;++i)
+        for(i=0; i<m_pSeq->total; ++i)
         {
             if(BlobID == CV_BLOB_ID(GetBlob(i)))
             {
@@ -563,7 +564,7 @@ public:
     virtual CvBlobTrack* GetBlobTrackByID(int TrackID)
     {
         int i;
-        for(i=0;i<m_pSeq->total;++i)
+        for(i=0; i<m_pSeq->total; ++i)
         {
             CvBlobTrack* pP = GetBlobTrack(i);
             if(pP && pP->TrackID == TrackID)
@@ -580,7 +581,7 @@ public:
     virtual void DelBlobTrackByID(int TrackID)
     {
         int i;
-        for(i=0;i<m_pSeq->total;++i)
+        for(i=0; i<m_pSeq->total; ++i)
         {
             CvBlobTrack* pP = GetBlobTrack(i);
             if(TrackID == pP->TrackID)
@@ -623,15 +624,15 @@ protected:
 class CV_EXPORTS CvBlobDetector: public CvVSModule
 {
 public:
-    /* try to detect new blob entrance based on foreground mask */
+    /* Try to detect new blob entrance based on foreground mask. */
     /* pFGMask - image of foreground mask */
-    /* pNewBlob - pointer to CvBlob structure which will bew filled if new blob entrance detected */
+    /* pNewBlob - pointer to CvBlob structure which will be filled if new blob entrance detected */
     /* pOldBlobList - pointer to blob list which already exist on image */
     virtual int DetectNewBlob(IplImage* pImg, IplImage* pImgFG, CvBlobSeq* pNewBlobList, CvBlobSeq* pOldBlobList) = 0;
     /* release blob detector */
     virtual void Release()=0;
 };
-/* release any blob detector*/
+/* Release any blob detector: */
 inline void cvReleaseBlobDetector(CvBlobDetector** ppBD)
 {
     ppBD[0]->Release();
@@ -639,7 +640,7 @@ inline void cvReleaseBlobDetector(CvBlobDetector** ppBD)
 }
 /* END BLOB DETECTOR INTERFACE */
 
-/* declaration of constructors of implemented modules */
+/* Declarations of constructors of implemented modules: */
 CV_EXPORTS CvBlobDetector* cvCreateBlobDetectorSimple();
 CV_EXPORTS CvBlobDetector* cvCreateBlobDetectorCC();
 
@@ -665,20 +666,20 @@ public:
     ~CvObjectDetector() {};
 
     /*
-     * Releases the current detector and loads new detector from file
+     * Release the current detector and load new detector from file
      * (if detector_file_name is not 0)
-     * Returns true on success
+     * Return true on success:
      */
     bool Load( const char* /*detector_file_name*/ = 0 ) { return false; }
 
-    /* Returns min detector window size */
+    /* Return min detector window size: */
     CvSize GetMinWindowSize() const { return cvSize(0,0); }
     
-    /* Returns max border */
+    /* Return max border: */
     int GetMaxBorderSize() const { return 0; }
 
     /*
-     * Detects the objects on the image and pushes the detected
+     * Detect the object on the image and push the detected
      * blobs into <detected_blob_seq> which must be the sequence of <CvDetectedBlob>s
      */
     void Detect( const CvArr* /*img*/, /* out */ CvBlobSeq* /*detected_blob_seq*/ = 0 ) {};
@@ -702,8 +703,8 @@ CV_INLINE CvRect cvRectIntersection( const CvRect r1, const CvRect r2 )
 /*
  * CvImageDrawer
  *
- * Draws on an image the specified ROIs from the source image and
- * given blobs as ellipses or rectangles
+ * Draw on an image the specified ROIs from the source image and
+ * given blobs as ellipses or rectangles:
  */
 
 struct CvDrawShape
@@ -740,7 +741,7 @@ protected:
 
 
 
-/* Trajectory generation module */
+/* Trajectory generation module: */
 class CV_EXPORTS CvBlobTrackGen: public CvVSModule
 {
 public:
@@ -756,7 +757,7 @@ inline void cvReleaseBlobTrackGen(CvBlobTrackGen** pBTGen)
     *pBTGen = 0;
 }
 
-/* declaration of constructors of implemented modules */
+/* Declarations of constructors of implemented modules: */
 CV_EXPORTS CvBlobTrackGen* cvCreateModuleBlobTrackGen1();
 CV_EXPORTS CvBlobTrackGen* cvCreateModuleBlobTrackGenYML();
 
@@ -767,26 +768,31 @@ class CV_EXPORTS CvBlobTracker: public CvVSModule
 {
 public:
     CvBlobTracker(){SetTypeName("BlobTracker");};
+
     /* Add new blob to track it and assign to this blob personal ID */
-    /* pBlob - pinter to structure with blob parameters (ID is ignored)*/
+    /* pBlob - pointer to structure with blob parameters (ID is ignored)*/
     /* pImg - current image */
     /* pImgFG - current foreground mask */
-    /* return pointer to new added blob */
+    /* Return pointer to new added blob: */
     virtual CvBlob* AddBlob(CvBlob* pBlob, IplImage* pImg, IplImage* pImgFG = NULL ) = 0;
-    /* return number of currently tracked blobs */
+
+    /* Return number of currently tracked blobs: */
     virtual int     GetBlobNum() = 0;
-    /* return pointer to specified by index blob */
+
+    /* Return pointer to specified by index blob: */
     virtual CvBlob* GetBlob(int BlobIndex) = 0;
     
-    /* delete blob by its index */
+    /* Delete blob by its index: */
     virtual void    DelBlob(int BlobIndex) = 0;
-    /* process current image and track all existed blobs */
+
+    /* Process current image and track all existed blobs: */
     virtual void    Process(IplImage* pImg, IplImage* pImgFG = NULL) = 0;
-    /* release blob tracker */
+
+    /* Release blob tracker: */
     virtual void    Release() = 0;
 
 
-    /* Process on blob (for multi hypothesis tracing) */
+    /* Process one blob (for multi hypothesis tracing): */
     virtual void ProcessBlob(int BlobIndex, CvBlob* pBlob, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL)
     {
         CvBlob* pB;
@@ -798,11 +804,13 @@ public:
             pBlob[0] = pB[0];
         pBlob->ID = ID;
     };
-    /* get confidence/wieght/probability (0-1) for blob */
+
+    /* Get confidence/wieght/probability (0-1) for blob: */
     virtual double  GetConfidence(int /*BlobIndex*/, CvBlob* /*pBlob*/, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL)
     {
         return 1;
     };
+
     virtual double GetConfidenceList(CvBlobSeq* pBlobList, IplImage* pImg, IplImage* pImgFG = NULL)
     {
         int     b,bN = pBlobList->GetBlobNum();
@@ -815,8 +823,10 @@ public:
         }
         return W;
     };
+
     virtual void UpdateBlob(int /*BlobIndex*/, CvBlob* /*pBlob*/, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL){};
-    /* update all blob models */
+
+    /* Update all blob models: */
     virtual void Update(IplImage* pImg, IplImage* pImgFG = NULL)
     {
         int i;
@@ -828,7 +838,7 @@ public:
 
     };
 
-    /* return pinter to blob by its unique ID */
+    /* Return pointer to blob by its unique ID: */
     virtual int     GetBlobIndexByID(int BlobID)
     {
         int i;
@@ -839,24 +849,33 @@ public:
         }
         return -1;
     };
-    /* return pinter to blob by its unique ID */
+
+    /* Return pointer to blob by its unique ID: */
     virtual CvBlob* GetBlobByID(int BlobID){return GetBlob(GetBlobIndexByID(BlobID));};
-    /* delete blob by its ID */
+
+    /* Delete blob by its ID: */
     virtual void    DelBlobByID(int BlobID){DelBlob(GetBlobIndexByID(BlobID));};
-    /* Set new parameters for specified (by index) blob */
+
+    /* Set new parameters for specified (by index) blob: */
     virtual void    SetBlob(int /*BlobIndex*/, CvBlob* /*pBlob*/){};
-    /* Set new parameters for specified (by ID) blob */
+
+    /* Set new parameters for specified (by ID) blob: */
     virtual void    SetBlobByID(int BlobID, CvBlob* pBlob)
     {
         SetBlob(GetBlobIndexByID(BlobID),pBlob);
     };
 
     /*  ===============  MULTI HYPOTHESIS INTERFACE ==================  */
-    /* return number of position hyposetis of currently tracked blob */
+
+    /* Return number of position hyposetis of currently tracked blob: */
     virtual int     GetBlobHypNum(int /*BlobIdx*/){return 1;};
-    /* return pointer to specified blob hypothesis by index blob */
+
+    /* Return pointer to specified blob hypothesis by index blob: */
     virtual CvBlob* GetBlobHyp(int BlobIndex, int /*hypothesis*/){return GetBlob(BlobIndex);};
-    /* Set new parameters for specified (by index) blob hyp (can be called several times for each hyp )*/
+
+    /* Set new parameters for specified (by index) blob hyp
+     * (can be called several times for each hyp ):
+     */
     virtual void    SetBlobHyp(int /*BlobIndex*/, CvBlob* /*pBlob*/){};
 };
 inline void cvReleaseBlobTracker(CvBlobTracker**ppT )
@@ -873,7 +892,8 @@ public:
     virtual void Init(CvBlob* pBlobInit, IplImage* pImg, IplImage* pImgFG = NULL) = 0;
     virtual CvBlob* Process(CvBlob* pBlobPrev, IplImage* pImg, IplImage* pImgFG = NULL) = 0;
     virtual void Release() =  0;
-    /*not required methods */
+
+    /* Non-required methods: */
     virtual void SkipProcess(CvBlob* /*pBlobPrev*/, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL){};
     virtual void Update(CvBlob* /*pBlob*/, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL){};
     virtual void SetCollision(int /*CollisionFlag*/){}; /* call in case of blob collision situation*/
@@ -891,9 +911,9 @@ inline void cvReleaseBlobTrackerOne(CvBlobTrackerOne **ppT )
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerList(CvBlobTrackerOne* (*create)());
 /*BLOB TRACKER ONE INTERFACE */
 
-/* declaration of constructors of implemented modules */
+/* Declarations of constructors of implemented modules: */
 
-/* some declaration for specific MeanShift tracker */
+/* Some declarations for specific MeanShift tracker: */
 #define PROFILE_EPANECHNIKOV    0
 #define PROFILE_DOG             1
 struct CvBlobTrackerParamMS
@@ -908,42 +928,54 @@ CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMS1(CvBlobTrackerParamMS* param);
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMS2(CvBlobTrackerParamMS* param);
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMS1ByList();
 
-/* some declaration for specific Liklyhood tracker */
+/* Some declarations for specific Likelihood tracker: */
 struct CvBlobTrackerParamLH
 {
     int     HistType; /* see Prob.h */
     int     ScaleAfter;
 };
 
-/* no scale optimization */
+/* Without scale optimization: */
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerLHR(CvBlobTrackerParamLH* /*param*/ = NULL);
-/* scale optimization */
+
+/* With scale optimization: */
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerLHRS(CvBlobTrackerParamLH* /*param*/ = NULL);
 
-/* simple blob tracker based on connected component tracking */
+/* Simple blob tracker based on connected component tracking: */
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerCC();
-/* connected component tracking and MSPF resolver for collision */
+
+/* Connected component tracking and mean-shift particle filter collion-resolver: */
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerCCMSPF();
-/* blob tracker that integrate MS and CC */
+
+/* Blob tracker that integrates meanshift and connected components: */
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMSFG();
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMSFGS();
-/* MS without CC */
+
+/* Meanshift without connected-components */
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMS();
-/* particle filtering using bahata... coefficient */
+
+/* Particle filtering via Bhattacharya coefficient, which        */
+/* is roughly the dot-product of two probability densities.      */
+/* See: Real-Time Tracking of Non-Rigid Objects using Mean Shift */
+/*      Comanicius, Ramesh, Meer, 2000, 8p                       */
+/*      http://citeseer.ist.psu.edu/321441.html                  */
 CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMSPF();
 
 /* =========== tracker integrators trackers =============*/
-/* integrator based on Partical Filtering method */
+
+/* Integrator based on Particle Filtering method: */
 //CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerIPF();
-/* rule based integrator */
+
+/* Rule based integrator: */
 //CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerIRB();
-/* integrator based on data fusion used particle filtering */
+
+/* Integrator based on data fusion using particle filtering: */
 //CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerIPFDF();
 
 
 
 
-/* Trajectory postprocessing module */
+/* Trajectory postprocessing module: */
 class CV_EXPORTS CvBlobTrackPostProc: public CvVSModule
 {
 public:
@@ -953,7 +985,7 @@ public:
     virtual CvBlob* GetBlob(int index) = 0;
     virtual void    Release() = 0;
 
-    /* additional functionality */
+    /* Additional functionality: */
     virtual CvBlob* GetBlobByID(int BlobID)
     {
         int i;
@@ -973,18 +1005,19 @@ inline void cvReleaseBlobTrackPostProc(CvBlobTrackPostProc** pBTPP)
     *pBTPP = 0;
 }
 
-/* Trajectory generation module */
+/* Trajectory generation module: */
 class CV_EXPORTS CvBlobTrackPostProcOne: public CvVSModule
 {
 public:
     virtual CvBlob* Process(CvBlob* pBlob) = 0;
     virtual void    Release() = 0;
 };
-/* create blob traking post processing module based on simle module */
+
+/* Create blob tracking post processing module based on simle module: */
 CV_EXPORTS CvBlobTrackPostProc* cvCreateBlobTrackPostProcList(CvBlobTrackPostProcOne* (*create)());
 
 
-/* declaration of constructors of implemented modules */
+/* Declarations of constructors of implemented modules: */
 CV_EXPORTS CvBlobTrackPostProc* cvCreateModuleBlobTrackPostProcKalman();
 CV_EXPORTS CvBlobTrackPostProc* cvCreateModuleBlobTrackPostProcTimeAverRect();
 CV_EXPORTS CvBlobTrackPostProc* cvCreateModuleBlobTrackPostProcTimeAverExp();
@@ -1003,7 +1036,7 @@ CV_EXPORTS CvBlobTrackPredictor* cvCreateModuleBlobTrackPredictKalman();
 
 
 
-/* Trajectory analyser module */
+/* Trajectory analyser module: */
 class CV_EXPORTS CvBlobTrackAnalysis: public CvVSModule
 {
 public:
@@ -1025,7 +1058,7 @@ inline void cvReleaseBlobTrackAnalysis(CvBlobTrackAnalysis** pBTPP)
     *pBTPP = 0;
 }
 
-/* feature vector generation module */
+/* Feature-vector generation module: */
 class CV_EXPORTS CvBlobTrackFVGen : public CvVSModule
 {
 public:
@@ -1034,14 +1067,14 @@ public:
     virtual void    Release() = 0;
     virtual int     GetFVSize() = 0;
     virtual int     GetFVNum() = 0;
-    virtual float*  GetFV(int index, int* pFVID) = 0; /* pointer to FV, if return 0 then FV does not created */
-    virtual float*  GetFVVar(){return NULL;}; /* returned pointer to array of variation of values of FV, if return 0 then FVVar is not exist */
-    virtual float*  GetFVMin() = 0; /* returned pointer to array of minimal values of FV, if return 0 then FVrange is not exist */
-    virtual float*  GetFVMax() = 0; /* returned pointer to array of maximal values of FV, if return 0 then FVrange is not exist */
+    virtual float*  GetFV(int index, int* pFVID) = 0; /* Returns pointer to FV, if return 0 then FV not created */
+    virtual float*  GetFVVar(){return NULL;}; /* Returns pointer to array of variation of values of FV, if returns 0 then FVVar does not exist. */
+    virtual float*  GetFVMin() = 0; /* Returns pointer to array of minimal values of FV, if returns 0 then FVrange does not exist */
+    virtual float*  GetFVMax() = 0; /* Returns pointer to array of maximal values of FV, if returns 0 then FVrange does not exist */
 };
 
 
-/* Trajectory Analyser module */
+/* Trajectory Analyser module: */
 class CV_EXPORTS CvBlobTrackAnalysisOne
 {
 public:
@@ -1052,38 +1085,47 @@ public:
     virtual void    Release() = 0;
 };
 
-/* create blob traking post processing module based on simle module */
+/* Create blob tracking post processing module based on simle module: */
 CV_EXPORTS CvBlobTrackAnalysis* cvCreateBlobTrackAnalysisList(CvBlobTrackAnalysisOne* (*create)());
 
-/* declaration of constructors of implemented modules */
-/* based on histogramm analysis of 2D FV (x,y)*/
+/* Declarations of constructors of implemented modules: */
+
+/* Based on histogram analysis of 2D FV (x,y): */
 CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisHistP();
-/* based on histogramm analysis of 4D FV (x,y,vx,vy)*/
+
+/* Based on histogram analysis of 4D FV (x,y,vx,vy): */
 CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisHistPV();
-/* based on histogramm analysis of 5D FV (x,y,vx,vy,state)*/
+
+/* Based on histogram analysis of 5D FV (x,y,vx,vy,state): */
 CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisHistPVS();
-/* based on histogramm analysis of 4D FV (startpos,stoppos)*/
+
+/* Based on histogram analysis of 4D FV (startpos,stoppos): */
 CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisHistSS();
 
-/* based on SVM classifier analysis of 2D FV (x,y)*/
+
+
+/* Based on SVM classifier analysis of 2D FV (x,y): */
 //CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMP();
-/* based on SVM classifier analysis of 4D FV (x,y,vx,vy)*/
+
+/* Based on SVM classifier analysis of 4D FV (x,y,vx,vy): */
 //CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMPV();
-/* based on SVM classifier analysis of 5D FV (x,y,vx,vy,state)*/
+
+/* Based on SVM classifier analysis of 5D FV (x,y,vx,vy,state): */
 //CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMPVS();
-/* based on SVM classifier analysis of 4D FV (startpos,stoppos)*/
+
+/* Based on SVM classifier analysis of 4D FV (startpos,stoppos): */
 //CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMSS();
 
-/* track analysis based on distance between tracks */
+/* Track analysis based on distance between tracks: */
 CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisTrackDist();
 
-/* analizer based on reation Road and height map*/
+/* Analyzer based on reation Road and height map: */
 //CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysis3DRoadMap();
 
-/* analizer that make OR desicion using set of analizers */
+/* Analyzer that makes OR decision using set of analyzers: */
 CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisIOR();
 
-/* estimator of human height */
+/* Estimator of human height: */
 class CV_EXPORTS CvBlobTrackAnalysisHeight: public CvBlobTrackAnalysis
 {
 public:
@@ -1093,7 +1135,7 @@ public:
 
 
 
-/* AUTO BLOB TRACKER INTERFACE - pipeline of 3 modules */
+/* AUTO BLOB TRACKER INTERFACE -- pipeline of 3 modules: */
 class CV_EXPORTS CvBlobTrackerAuto: public CvVSModule
 {
 public:
@@ -1104,8 +1146,8 @@ public:
     virtual IplImage*   GetFGMask(){return NULL;};
     virtual float       GetState(int BlobID) = 0;
     virtual char*       GetStateDesc(int BlobID) = 0;
-    /* return 0 if trajectory is normal
-       return >0 if trajectory abnormal */
+    /* return 0 if trajectory is normal;
+     * return >0 if trajectory abnormal. */
     virtual void    Release() = 0;
 };
 inline void cvReleaseBlobTrackerAuto(CvBlobTrackerAuto** ppT)
@@ -1116,29 +1158,37 @@ inline void cvReleaseBlobTrackerAuto(CvBlobTrackerAuto** ppT)
 /* END AUTO BLOB TRACKER INTERFACE */
 
 
-/* creation function and data for specific BlobTRackerAuto modules */
-/* parameters of blobtracker auto ver1 */
+/* Constructor functions and data for specific BlobTRackerAuto modules: */
+
+/* Parameters of blobtracker auto ver1: */
 struct CvBlobTrackerAutoParam1
 {
-    int                     FGTrainFrames; /* number of frames are needed for FG detector to train */
-    CvFGDetector*           pFG; /* FGDetector module, if this filed is NULL the Process FG mask is used */
-    CvBlobDetector*         pBD; /* existed blob detector module
-                                if this filed is NULL default blobdetector module will be created */
-    CvBlobTracker*          pBT; /* existed blob tracking module
-                                if this filed is NULL default blobtracker module will be created */
-    CvBlobTrackGen*         pBTGen; /* existed blob trajectory generator,
-                                if this filed is NULL no any generator is used */
-    CvBlobTrackPostProc*    pBTPP; /* existed blob trajectory postprocessing module
-                                if this filed is NULL no any postprocessing is used */
+    int                     FGTrainFrames; /* Number of frames needed for FG (foreground) detector to train.        */
+
+    CvFGDetector*           pFG;           /* FGDetector module. If this field is NULL the Process FG mask is used. */
+
+    CvBlobDetector*         pBD;           /* Selected blob detector module.                                       */
+                                           /* If this field is NULL default blobdetector module will be created.    */
+
+    CvBlobTracker*          pBT;           /* Selected blob tracking module.                                       */  
+                                           /* If this field is NULL default blobtracker module will be created.     */
+
+    CvBlobTrackGen*         pBTGen;        /* Selected blob trajectory generator.                                  */
+                                           /* If this field is NULL no generator is used.                           */
+
+    CvBlobTrackPostProc*    pBTPP;         /* Selected blob trajectory postprocessing module.                      */
+                                           /* If this field is NULL no postprocessing is done.                      */
+
     int                     UsePPData;
-    CvBlobTrackAnalysis*    pBTA; /* existed blob trajectory analysis module */
-                                  /* if this filed is NULL no any analysis is made */
+
+    CvBlobTrackAnalysis*    pBTA;          /* Selected blob trajectory analysis module.                             */
+                                           /* If this field is NULL no track analysis is done.                      */
 };
 
-/* create blob tracker auto ver1 */
+/* Create blob tracker auto ver1: */
 CV_EXPORTS CvBlobTrackerAuto* cvCreateBlobTrackerAuto1(CvBlobTrackerAutoParam1* param = NULL);
 
-/* simple loader for many auto trackers by its type  */
+/* Simple loader for many auto trackers by its type : */
 inline CvBlobTrackerAuto* cvCreateBlobTrackerAuto(int type, void* param)
 {
     if(type == 0) return cvCreateBlobTrackerAuto1((CvBlobTrackerAutoParam1*)param);
@@ -1161,7 +1211,7 @@ struct CvTracksTimePos
                    FILE *file);*/
 
 
-/*  Create functions  */
+/* Constructor functions:  */
 
 CV_EXPORTS void cvCreateTracks_One(CvBlobTrackSeq *TS);
 CV_EXPORTS void cvCreateTracks_Same(CvBlobTrackSeq *TS1, CvBlobTrackSeq *TS2);
@@ -1173,9 +1223,11 @@ class CV_EXPORTS CvProb
 {
 public:
     virtual ~CvProb() {};
-    /* calculate probability value */ 
+
+    /* Calculate probability value: */ 
     virtual double Value(int* /*comp*/, int /*x*/ = 0, int /*y*/ = 0){return -1;};
-    /* update histograpp Pnew = (1-W)*Pold + W*Padd*/
+
+    /* Update histograpp Pnew = (1-W)*Pold + W*Padd*/
     /* W weight of new added prob */
     /* comps - matrix of new fetature vectors used to update prob */
     virtual void AddFeature(float W, int* comps, int x =0, int y = 0) = 0;
@@ -1185,7 +1237,7 @@ public:
 inline void cvReleaseProb(CvProb** ppProb){ppProb[0]->Release();ppProb[0]=NULL;}
 /* HIST API */
 
-/* some Prob */
+/* Some Prob: */
 CV_EXPORTS CvProb* cvCreateProbS(int dim, CvSize size, int sample_num);
 CV_EXPORTS CvProb* cvCreateProbMG(int dim, CvSize size, int sample_num);
 CV_EXPORTS CvProb* cvCreateProbMG2(int dim, CvSize size, int sample_num);
@@ -1206,13 +1258,14 @@ inline CvProb* cvCreateProb(int type, int dim, CvSize size = cvSize(1,1), void*
 
 
 
-/* noise types defenition */
+/* Noise type definitions: */
 #define CV_NOISE_NONE               0
 #define CV_NOISE_GAUSSIAN           1
 #define CV_NOISE_UNIFORM            2
 #define CV_NOISE_SPECKLE            3
 #define CV_NOISE_SALT_AND_PEPPER    4
-/* Add some noise to image */
+
+/* Add some noise to image: */
 /* pImg - (input) image without noise */
 /* pImg - (output) image with noise */
 /* noise_type - type of added noise */
@@ -1227,36 +1280,42 @@ CV_EXPORTS void cvAddNoise(IplImage* pImg, int noise_type, double Ampl, CvRandSt
 /*================== GENERATOR OF TEST VIDEO SEQUENCE ===================== */
 typedef void CvTestSeq;
 
-/* pConfigfile - name of file (yml or xml) with description of test sequence */
+/* pConfigfile - Name of file (yml or xml) with description of test sequence */
 /* videos - array of names of test videos described in "pConfigfile" file */
 /* numvideos - size of "videos" array */
 CV_EXPORTS CvTestSeq* cvCreateTestSeq(char* pConfigfile, char** videos, int numvideo, float Scale = 1, int noise_type = CV_NOISE_NONE, double noise_ampl = 0);
 CV_EXPORTS void cvReleaseTestSeq(CvTestSeq** ppTestSeq);
 
-/* generete next frame from test video seq and return pointer to it */
+/* Generate next frame from test video seq and return pointer to it: */
 CV_EXPORTS IplImage* cvTestSeqQueryFrame(CvTestSeq* pTestSeq);
-/* return pointer to current foreground mask */
+
+/* Return pointer to current foreground mask: */
 CV_EXPORTS IplImage* cvTestSeqGetFGMask(CvTestSeq* pTestSeq);
-/* return pointer to current image */
+
+/* Return pointer to current image: */
 CV_EXPORTS IplImage* cvTestSeqGetImage(CvTestSeq* pTestSeq);
-/* return frame size of result test video */
+
+/* Return frame size of result test video: */
 CV_EXPORTS CvSize cvTestSeqGetImageSize(CvTestSeq* pTestSeq);
-/* return number of frames result test video */
+
+/* Return number of frames result test video: */
 CV_EXPORTS int cvTestSeqFrameNum(CvTestSeq* pTestSeq);
 
-/* return number of existed objects 
- this is general number of any objects. 
-for example number of trajectories may be equal or less than returned value*/
+/* Return number of existing objects. 
+ * This is general number of any objects. 
+ * For example number of trajectories may be equal or less than returned value:
+ */
 CV_EXPORTS int cvTestSeqGetObjectNum(CvTestSeq* pTestSeq);
 
-/* return 0 if there is not position for current defined on current frame */
-/* return 1 if there is object position and pPos was filled */
+/* Return 0 if there is not position for current defined on current frame */
+/* Return 1 if there is object position and pPos was filled */
 CV_EXPORTS int cvTestSeqGetObjectPos(CvTestSeq* pTestSeq, int ObjIndex, CvPoint2D32f* pPos);
 CV_EXPORTS int cvTestSeqGetObjectSize(CvTestSeq* pTestSeq, int ObjIndex, CvPoint2D32f* pSize);
 
-/* add noise to finile image */
+/* Add noise to final image: */
 CV_EXPORTS void cvTestSeqAddNoise(CvTestSeq* pTestSeq, int noise_type = CV_NOISE_NONE, double noise_ampl = 0);
-/* add Intensity variation */
+
+/* Add Intensity variation: */
 CV_EXPORTS void cvTestSeqAddIntensityVariation(CvTestSeq* pTestSeq, float DI_per_frame, float MinI, float MaxI);
 CV_EXPORTS void cvTestSeqSetFrame(CvTestSeq* pTestSeq, int n);