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

void Impala::Application::IDash::DoProcessAnnotationSet ( CString  setArg  ) 

Definition at line 25 of file mainIDashServer.cpp.

References Impala::Core::IDash::VideoSetWrapper::Add(), Impala::Core::Table::AnnotationTable::AddNegative(), Impala::Core::Table::AnnotationTable::AddPositive(), Impala::Core::Database::RawDataSet::GetLocator(), Impala::Core::IDash::XmlAnnotationSet::GetMoment(), Impala::Core::IDash::XmlAnnotationSet::GetNrMoments(), Impala::Core::Table::AnnotationTableSet::GetTable(), Impala::Core::IDash::VideoSetWrapper::GetVideoSet(), ILOG_ERROR, ILOG_VAR, Impala::QUID_CLASS_FRAME, and Impala::Core::IDash::XmlAnnotationSet::Valid().

Referenced by mainIDashServer().

00026 {
00027     ILOG_VAR(Impala.Application.IDash.DoProcessAnnotationSet);
00028     using namespace Persistency;
00029 
00030     Util::StringParser p(setArg);
00031     if (p.Contains("keyvalue"))
00032     {
00033         ILOG_ERROR("annotationset should not contain keyvalue");
00034         return;
00035     }
00036     p.Eat("keyword=");
00037     if (p.TheEnd())
00038     {
00039         ILOG_ERROR("annotationset should contain keyword");
00040         return;
00041     }
00042     String keyword = p.GetString('&', false);
00043     Core::Table::KeywordList keyList;
00044     keyList.push_back(keyword);
00045     Core::Table::AnnotationTableSet annoSet(keyList, 0);
00046 
00047     Core::IDash::VideoSetWrapper vidSet("idash_annotator.txt");
00048     Core::IDash::XmlAnnotationSet xmlAnnotationSetT(setArg + "&keyvalue=true");
00049     if (!xmlAnnotationSetT.Valid())
00050         return;
00051     Core::Table::AnnotationTable* tab = annoSet.GetTable(keyword);
00052     for (int i=0 ; i<xmlAnnotationSetT.GetNrMoments() ; i++)
00053     {
00054         Core::IDash::XmlShot xmlShot(xmlAnnotationSetT.GetMoment(i));
00055         Core::IDash::XmlVideo xmlVideo(xmlShot.GetVideo());
00056         Quid q = vidSet.Add(xmlVideo, xmlShot.GetShotIndex());
00057         tab->AddPositive(q);
00058     }
00059 
00060     Core::IDash::XmlAnnotationSet xmlAnnotationSetF(setArg + "&keyvalue=false");
00061     if (!xmlAnnotationSetF.Valid())
00062         return ;
00063     for (int i=0 ; i<xmlAnnotationSetF.GetNrMoments() ; i++)
00064     {
00065         Core::IDash::XmlShot xmlShot(xmlAnnotationSetF.GetMoment(i));
00066         Core::IDash::XmlVideo xmlVideo(xmlShot.GetVideo());
00067         Quid q = vidSet.Add(xmlVideo, xmlShot.GetShotIndex());
00068         tab->AddNegative(q);
00069     }
00070 
00071     Core::VideoSet::VideoSet* vs = vidSet.GetVideoSet();
00072     AnnotationTableSetLocator setLoc(vs->GetLocator(), QUID_CLASS_FRAME,
00073                                      "conceptsAnnotator.txt");
00074     AnnotationTableSetRepository().Add(setLoc, &annoSet);
00075 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:14:42 2011 for ImpalaSrc by  doxygen 1.5.1