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

void Impala::Application::Util::DoExportAnnoTruth (  ) 

Definition at line 704 of file mainUtil.cpp.

References Impala::FileNameBase(), Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetInstance(), Impala::Core::Database::RawDataSet::GetLocator(), Impala::CmdOptions::GetNrArg(), Impala::Persistency::File::GetPath(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::VideoSet::MakeVideoSet(), Impala::QUID_CLASS_FRAME, and Impala::Persistency::File::WriteStrings().

Referenced by mainUtil().

00705 {
00706     typedef Core::VideoSet::VideoSet VideoSet;
00707     typedef Core::VideoSet::Keyframes Keyframes;
00708     typedef Core::Table::AnnotationTableSet AnnotationTableSet;
00709     typedef Core::Table::AnnotationTable AnnotationTable;
00710     typedef Core::Table::QuidTable QuidTable;
00711 
00712     ILOG_VAR(Impala.Application.Util.DoExportAnnoTruth);
00713     CmdOptions& options = CmdOptions::GetInstance();
00714     if (options.GetNrArg() < 3)
00715     {
00716         ILOG_ERROR("Need more parameters");
00717         return;
00718     }
00719     String videoSetName = options.GetArg(1);
00720     String conceptSet = options.GetArg(2);
00721 
00722     VideoSet* vidSet = Core::VideoSet::MakeVideoSet(videoSetName);
00723     KeyframesLocator kLoc(vidSet->GetLocator(), "keyframes");
00724     Keyframes* keyframes = KeyframesRepository().Get(kLoc, vidSet);
00725     AnnotationTableSetLocator aLoc(vidSet->GetLocator(), QUID_CLASS_FRAME,
00726                                    conceptSet);
00727     AnnotationTableSet* tSet = AnnotationTableSetRepository().Get(aLoc);
00728     if (tSet == 0)
00729         return;
00730 
00731     for (int t=0 ; t<tSet->Size() ; t++)
00732     {
00733         AnnotationTable* tab = tSet->GetTable(t);
00734         tab->DumpSummary();
00735         QuidTable* quids = tab->GetPositive();
00736         std::vector<String> annos;
00737         for (int i=0 ; i<quids->Size() ; i++)
00738         {
00739             Quid q = quids->Get1(i);
00740             int id = keyframes->GetFrameId(q);
00741             if (id != -1)
00742             {
00743                 String name = keyframes->GetName(id);
00744                 annos.push_back(FileNameBase(name));
00745             }
00746         }
00747         delete quids;
00748 
00749         String fName = "Annotations/groundtruth/" + conceptSet + "/" +
00750             tab->GetLabel() + ".truth";
00751         Persistency::FileLocator fLoc(vidSet->GetLocator(), fName);
00752         typedef Persistency::RepositoryInFileSystem FS;
00753         Persistency::File file = FS::GetInstance().GetFile(fLoc, true, false);
00754         ILOG_INFO("Writing to " << file.GetPath());
00755         file.WriteStrings(annos);
00756     }
00757     delete tSet;
00758     delete keyframes;
00759     delete vidSet;
00760 }

Here is the call graph for this function:


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