Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

CheckNrFrames.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_VideoSet_CheckNrFrames_h
00002 #define Impala_Core_VideoSet_CheckNrFrames_h
00003 
00004 #include "Core/VideoSet/Reporter.h"
00005 #include "Core/VideoSet/Segmentation.h"
00006 
00007 namespace Impala
00008 {
00009 namespace Core
00010 {
00011 namespace VideoSet
00012 {
00013 
00014 
00015 class CheckNrFrames : public Listener
00016 {
00017 public:
00018 
00019     CheckNrFrames(Reporter* reporter, CmdOptions& options)
00020     {
00021         mReporter = reporter;
00022         mSegmentation = 0;
00023         mMargin = 0;
00024         if (options.GetNrArg() != 3)
00025         {
00026             ILOG_ERROR("Need 3 arguments");
00027         }
00028         else
00029         {
00030             mMargin = atol(options.GetArg(2));
00031         }
00032     }
00033 
00034     virtual void
00035     HandleNewWalk(VideoSet* vs, Segmentation* segmentation)
00036     {
00037         mSegmentation = segmentation;
00038     }
00039 
00040     virtual void
00041     HandleNewFile(VideoSet* vs, int fileId, Stream::RgbDataSrc* src)
00042     {
00043         if (!mSegmentation)
00044         {
00045             ILOG_ERROR("No segmentation given");
00046             return;
00047         }
00048         int srcNr = src->LastFrame() + 1;
00049         int segNr = mSegmentation->GetNrFramesVideo(fileId);
00050         int d = abs(srcNr - segNr);
00051         if (d > mMargin)
00052         {
00053             ILOG_ERROR("Frame difference is " << d << " for file " <<
00054                        vs->GetFile(fileId) << " (src says " << srcNr <<
00055                        ", segmentation says " << segNr << ")");
00056         }
00057         if ((d > 0) && (mMargin != 0))
00058             ILOG_INFO("Frame difference is " << d << " for file " <<
00059                        vs->GetFile(fileId) << " (src says " << srcNr <<
00060                        ", segmentation says " << segNr << ")");
00061     }
00062 
00063 private:
00064 
00065     Reporter*     mReporter;
00066     Segmentation* mSegmentation;
00067     int           mMargin;
00068 
00069     ILOG_VAR_DEC;
00070 
00071 };
00072 
00073 ILOG_VAR_INIT(CheckNrFrames, Impala.Core.VideoSet);
00074 
00075 } // namespace VideoSet
00076 } // namespace Core
00077 } // namespace Impala
00078 
00079 #endif

Generated on Fri Mar 19 09:31:29 2010 for ImpalaSrc by  doxygen 1.5.1