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

void Impala::Application::Util::DoConcepts2AllFrames (  ) 

Definition at line 1656 of file mainUtil.cpp.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::CmdOptions::GetArg(), Impala::Core::Database::RawDataSet::GetContainer(), Impala::Core::Table::QuidTable::GetFirstQuidObject(), Impala::CmdOptions::GetInstance(), Impala::Core::Database::RawDataSet::GetLocator(), Impala::CmdOptions::GetNrArg(), Impala::Core::VideoSet::Segmentation::GetNrFramesVideo(), Impala::Core::Table::QuidTable::GetNrQuidsObject(), Impala::Core::VideoSet::Segmentation::GetNrShotsVideo(), Impala::Core::VideoSet::VideoSet::GetQuidFrame(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::VideoSet::MakeVideoSet(), Impala::Core::Database::RawDataSet::NrFiles(), Impala::QuidObject(), Impala::Core::Table::Table::Size(), and Impala::Core::Table::QuidTable::UpdateGroups().

Referenced by mainUtil().

01657 {
01658     typedef Core::VideoSet::VideoSet VideoSet;
01659     typedef Core::VideoSet::Segmentation Segmentation;
01660     typedef Core::Table::SimilarityTableSet SimilarityTableSet;
01661     typedef Core::Table::SimilarityTableSet::SimTableType SimTableType;
01662 
01663     ILOG_VAR(Impala.Application.Util.DoConceptsExtra2AllFrames);
01664     CmdOptions& options = CmdOptions::GetInstance();
01665     if (options.GetNrArg() < 5)
01666     {
01667         ILOG_ERROR("Need more parameters");
01668         return;
01669     }
01670     String vidSetName = options.GetArg(1);
01671     String conceptSet = options.GetArg(2);
01672     String model = options.GetArg(3);
01673     String feature = options.GetArg(4);
01674 
01675     VideoSet* vidSet = Core::VideoSet::MakeVideoSet(vidSetName);
01676     SegmentationLocator sLoc(vidSetName, "segmentation", options);
01677     Segmentation* segmentation = SegmentationRepository().Get(sLoc, vidSet);
01678     SimilarityTableSetLocator srcLoc(vidSet->GetLocator(), true, "",
01679                                      conceptSet, model, feature, "");
01680     SimilarityTableSet* srcSet = SimilarityTableSetRepository().Get(srcLoc);
01681  
01682     Core::Table::QuidTable* srcQuids = srcSet->GetQuidTable();
01683     srcQuids->UpdateGroups();
01684     for (int v=0 ; v<vidSet->NrFiles() ; v++)
01685     {
01686         int nrFrames = segmentation->GetNrFramesVideo(v);
01687         ILOG_INFO("Video " << v << " has " << nrFrames << " frames and " <<
01688                   segmentation->GetNrShotsVideo(v) << " shots");
01689         SimilarityTableSet* dstSet = new SimilarityTableSet(srcSet->GetNames(),
01690                                                             nrFrames);
01691         Core::Table::QuidTable* dstQuids = dstSet->GetQuidTable();
01692         for (int t=0 ; t<srcSet->NrTables() ; t++)
01693         {
01694             SimTableType* srcSimTable = srcSet->GetSimTable(t);
01695             SimTableType* dstSimTable = dstSet->GetSimTable(t);
01696             for (int f=0 ; f<nrFrames ; f++)
01697             {
01698                 Quid quid = vidSet->GetQuidFrame(v, f);
01699                 if (t == 0)
01700                     dstQuids->Add(quid);
01701                 Real64 sim = 0;
01702                 int obj = QuidObject(quid);
01703                 int start = srcQuids->GetFirstQuidObject(obj);
01704                 int nr = srcQuids->GetNrQuidsObject(obj);
01705                 int idx = srcQuids->Size();
01706                 for (int i=start ; i<start+nr ; i++)
01707                 {
01708                     if (srcQuids->Get1(i) == quid)
01709                     {
01710                         idx = i;
01711                         break;
01712                     }
01713                 }
01714                 if (idx != srcQuids->Size())
01715                 {
01716                     sim = srcSimTable->Get1(idx);
01717                 }
01718                 dstSimTable->Add(sim);
01719             }
01720         }
01721 
01722         // Not used right now, so skipping...
01723         //dstSet->ComputeRanks(true);
01724         SimilarityTableSetLocator dstLoc(vidSet->GetLocator(), false, "Frames",
01725                                          conceptSet, model, feature,
01726                                          vidSet->GetContainer(v));
01727         SimilarityTableSetRepository().Add(dstLoc, dstSet);
01728         delete dstSet;
01729     }
01730     delete srcSet;
01731     delete vidSet;
01732 }

Here is the call graph for this function:


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