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

void Impala::Application::Util::DoTrecMissing (  ) 

Definition at line 306 of file mainUtil.cpp.

References Impala::FileNameBase(), Impala::CmdOptions::GetArg(), Impala::Core::VideoSet::Keyframes::GetFrameId(), Impala::CmdOptions::GetInstance(), Impala::Core::Database::RawDataSet::GetLocator(), Impala::CmdOptions::GetNrArg(), Impala::Core::VideoSet::Keyframes::GetQuidFrame(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::VideoSet::MakeVideoSet(), and Impala::Persistency::File::ReadStrings().

Referenced by mainUtil().

00307 {
00308     typedef Core::VideoSet::VideoSet VideoSet;
00309     typedef Core::VideoSet::Keyframes Keyframes;
00310     typedef Core::Table::QuidTable QuidTable;
00311 
00312     ILOG_VAR(Impala.Application.Util.DoTrecMissing);
00313     CmdOptions& options = CmdOptions::GetInstance();
00314     if (options.GetNrArg() < 2)
00315     {
00316         ILOG_ERROR("Need at least 2 arguments");
00317         return;
00318     }
00319     String setName = options.GetArg(1);
00320     String missingName = options.GetArg(2);
00321 
00322     VideoSet* vidSet = Core::VideoSet::MakeVideoSet(setName);
00323     KeyframesLocator kLoc(setName, "keyframes", options);
00324     Keyframes* keyframes = KeyframesRepository().Get(kLoc, vidSet);
00325 
00326     Persistency::FileLocator fLoc(vidSet->GetLocator(), missingName);
00327     typedef Persistency::RepositoryInFileSystem FS;
00328     Persistency::File file = FS::GetInstance().GetFile(fLoc, false, false);
00329     std::vector<String> missing;
00330     file.ReadStrings(missing);
00331     std::cout << "missing size = " << missing.size() << std::endl;
00332 
00333     QuidTable* quids = new QuidTable();
00334     int nrFiles = 0;
00335     int nrShots = 0;
00336     for (int i=0 ; i<missing.size() ; i++)
00337     {
00338         int keyId = keyframes->GetFrameId(missing[i]);
00339         if (keyId == -1)
00340         {
00341             ILOG_ERROR("Could find keyframe " << missing[i]);
00342             continue;
00343         }
00344         Quid q = keyframes->GetQuidFrame(keyId);
00345         quids->Add(q);
00346     }
00347     ILOG_INFO("quid size = " << quids->Size());
00348 
00349     QuidTableLocator qLoc(vidSet->GetLocator(), "VideoIndex",
00350                           FileNameBase(missingName) + ".tab");
00351     QuidTableRepository().Add(qLoc, quids);
00352     delete quids;
00353     delete keyframes;
00354     delete vidSet;
00355 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:16:27 2011 for ImpalaSrc by  doxygen 1.5.1