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

Impala::Core::VideoSet::ShotSegmenter::ShotSegmenter ( Reporter reporter,
CmdOptions options 
) [inline]

Definition at line 58 of file ShotSegmenter.h.

References Impala::CmdOptions::GetBool(), Impala::CmdOptions::GetDouble(), Impala::Util::Database::GetFilePath(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInt(), Impala::CmdOptions::GetString(), ILOG_INFO, Impala::Core::Training::Svm::LoadModel(), Impala::Core::Array::MakeGaussian1d(), mBinCount, mBlur, mBlurDer, mBlurSigma, mCentered, mDataDir, mDoProcessing, mFeatures, mFeaturesReversed, mGauss, mGUI, mHistEq, mHistNorm, mHistograms, mHistPerFrame, mHistSim, mMode, mNormW, mPredictions, mPredictOnly, mPredictOutput, mProbThresh, mPyramid, mPyrL, mPyrU, mRadius, mRefDir, mRefPrefix, mReporter, mRunName, mScores, mShortGrad, mSigma, mSim, mSvm, mSvmModelFile, mSymmetry, mThreshold, mThresholdOnly, mVerbose, mWindowSize, and Impala::Core::Geometry::RectanglePyramid::TotalNrRects().

00059     {
00060         //Walk Listener setup////////////////////
00061         mReporter = reporter;
00062         
00063         mScores=0;
00064         mPredictions=0;
00065         mFeatures=0;
00066         mFeaturesReversed=0;
00067         mHistograms=0;
00068         
00069         //Similarity Types
00070         mSim         = options.GetString ("SSSim","+");
00071         mHistSim     = options.GetString ("SSHistSim","Intersection");
00072         mSymmetry    = options.GetString ("SSSymmetry","None");
00073 
00074         //Preprocessing
00075         mHistEq      = options.GetBool   ("SSHistEq",false);
00076         mHistNorm    = options.GetBool   ("SSHistNorm",true);
00077         mBlur        = options.GetBool   ("SSBlur",true);
00078         mBlurDer     = options.GetBool   ("SSBlurDer",0);
00079         mBlurSigma   = options.GetDouble ("SSBlurSigma",1.);
00080         mNormW       = options.GetBool   ("SSNormW",false);
00081 
00082         //GPM Parameters///////////////////////////////////////
00083         mThreshold   = options.GetDouble ("SSThreshold",3.4);
00084         mRadius      = options.GetInt    ("SSRadius",6);
00085         mSigma       = options.GetDouble ("SSSigma",18);
00086         mBinCount    = options.GetInt    ("SSBinCount",32);
00087         mCentered    = options.GetBool   ("SSCentered",false);
00088         mPyrL        = options.GetInt    ("SSPyrL",1);
00089         mPyrU        = options.GetInt    ("SSPyrU",2);
00090         mProbThresh  = options.GetDouble ("SSProbThresh",0.5);
00091         mShortGrad   = options.GetInt    ("SSShortGrad",3); //Anything
00092 
00093         //RunModes/////////////////////////////////////////////
00094         mMode         = options.GetString ("SSMode","Run");          //Test,Train,EvalTrain,EvalTest,Run
00095         mRunName      = options.GetString ("SSRunName","NoRunName"); //Anything
00096         mGUI          = options.GetBool   ("SSGUI",false);
00097         mThresholdOnly= options.GetBool   ("SSThresholdOnly",false);
00098         mPredictOnly  = options.GetBool   ("SSPredictOnly",false);
00099         mPredictOutput= options.GetBool   ("SSPredictOutput",false);
00100         mDoProcessing = options.GetBool   ("SSDoProcessing",true);
00101         mDoProcessing = mDoProcessing&&(!(mThresholdOnly||mPredictOnly));
00102         
00103         //Directories//////////////////////////////////////////
00104         mDataDir      = options.GetString ("data");
00105         mRefDir       = options.GetString ("SSRefDir");
00106         if(mRefDir==""){
00107             mRefDir=mDataDir+"/ShotSegmentation/ref";
00108         }
00109         
00110         //Other
00111         mRefPrefix   = options.GetString ("SSRefPrefix","/ref_");
00112         mSvmModelFile= options.GetString ("SSModelFile","default");
00113         mVerbose     = options.GetInt   ("SSVerbose",0);
00114         
00115         mWindowSize  = mCentered ? 2 * mRadius + 1 : 2 * mRadius;
00116 
00117         ILOG_INFO("Shot Segmentation Parameters:");
00118         ILOG_INFO("---------------------------------");
00119         ILOG_INFO("  Radius    :"<<mRadius);
00120         ILOG_INFO("  Sigma     :"<<mSigma);
00121         ILOG_INFO("  BinCount  :"<<mBinCount);
00122         ILOG_INFO("  Threshold :"<<mThreshold);
00123         ILOG_INFO("  HistEq    :"<<(mHistEq ? "yes" : "no"));
00124         ILOG_INFO("  HistNorm  :"<<(mHistNorm ? "yes" : "no"));
00125         ILOG_INFO("  Sim       :"<<mSim);
00126         ILOG_INFO("  HistSim   :"<<mHistSim);
00127         ILOG_INFO("  Symmetry  :"<<mSymmetry);
00128         ILOG_INFO("  Centered  :"<<(mCentered?"yes":"no"));
00129         ILOG_INFO("  Blur      :"<<(mBlur?"yes":"no"));
00130         ILOG_INFO("  BlurDer   :"<<mBlurDer);
00131         ILOG_INFO("  BlurSigma :"<<mBlurSigma);
00132         ILOG_INFO("  mNormW    :"<<(mNormW?"yes":"no"));
00133         ILOG_INFO("  ProbThresh:"<<mProbThresh);
00134         ILOG_INFO("  ShortGrad :"<<mShortGrad);
00135         ILOG_INFO("  Pyr. Lower:"<<mPyrL);
00136         ILOG_INFO("  Pyr. Upper:"<<mPyrU);
00137         ILOG_INFO("");
00138         ILOG_INFO("Shot Segmentation Modes:");
00139         ILOG_INFO("---------------------------------");
00140         ILOG_INFO("  Mode      :"<<mMode);
00141         ILOG_INFO("  GUI       :"<<(mGUI ? "yes" : "no"));
00142         ILOG_INFO("  RunName   :"<<mRunName);
00143         ILOG_INFO("  ThreshOnly:"<<(mThresholdOnly?"yes":"no"));
00144         ILOG_INFO("  PredctOnly:"<<(mPredictOnly?"yes":"no"));
00145         ILOG_INFO("  PredctOut :"<<(mPredictOutput?"yes":"no"));
00146         ILOG_INFO("  Processing:"<<(mDoProcessing?"yes":"no"));
00147         ILOG_INFO("");
00148         ILOG_INFO("Shot Segmentation Directories:");
00149         ILOG_INFO("---------------------------------");
00150         ILOG_INFO("  Data      :"<<mDataDir);
00151         ILOG_INFO("  Ref       :"<<mRefDir);
00152         ILOG_INFO("  ModelFile :"<<mSvmModelFile);
00153             
00154         mPyramid=Geometry::RectanglePyramid(0,mPyrL,mPyrU,1,-1,-1);
00155 
00156         ILOG_INFO("Pyramid has "<< mPyramid.TotalNrRects()<<" rectangles.");
00157         mHistPerFrame = 3 * mPyramid.TotalNrRects();
00158 
00159 #ifndef REPOSITORY_USED // Here comes the deprecated stuff
00160         if(((mMode=="Run")||(mPredictOnly))&&(mSvmModelFile==""))
00161         {
00162             ILOG_INFO("You should supply a model file for prediction!");
00163             ILOG_INFO("Prediction will not be possible!");
00164             return;
00165         }
00166         else if((mMode=="Run")||(mPredictOnly))
00167         {
00168             mSvm=new Core::Training::Svm;
00169             
00170             Util::Database& Db = Util::Database::GetInstance();
00171             String FileName=Db.GetFilePath("ShotSegmentation","Models",mRunName,mSvmModelFile,false,true);
00172             if (FileName!=""){
00173                 ILOG_INFO("Loading Model");
00174                 mSvm->LoadModel(FileName, &Db);
00175                 ILOG_INFO("Loaded Model");
00176             }else{
00177                 delete mSvm;
00178                 mSvm=0;
00179                 ILOG_INFO("SVM file not opened");
00180             }
00181             //TODO:get the SS parameters from the file name
00182             //standardize file names
00183         }else{
00184             ILOG_INFO("No SVM");
00185             mSvm=0;
00186         }
00187 #else // REPOSITORY_USED
00188         ILOG_INFO("No SVM");
00189 #endif // REPOSITORY_USED
00190         
00191         //Prepare the 1-d gaussian filter to be used for scaling in time
00192         mGauss = Array::MakeGaussian1d(mSigma,0,0,mWindowSize*2+1,mWindowSize*2+1);
00193         
00194     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:32:09 2010 for ImpalaSrc by  doxygen 1.5.1