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

virtual void Impala::Core::Trec::ThreadVisualSimilarity::SetOrigin ( int  shot  )  [inline, virtual]

Reimplemented from Impala::Core::Trec::Thread.

Definition at line 86 of file ThreadVisualSimilarity.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Add(), Impala::Core::Table::SimilarityTableSet::ComputeRanksTopN(), Impala::Core::Feature::FeatureTable::FindFeature(), Impala::Core::Table::SimilarityTableSet::FindQuid(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::GetColumn1(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::GetColumn2(), Impala::Core::VideoSet::Keyframes::GetFrameId(), Impala::Core::VideoSet::Keyframes::GetQuidFrame(), Impala::Core::Table::SimilarityTableSet::GetRankTable(), Impala::Core::VideoSet::Keyframes::GetShotId(), Impala::Core::Table::SimilarityTableSet::GetSimTable(), ILOG_DEBUG, mFeatureTable, Impala::Min(), mKeyframes, mOrigin, mShotsCache, mSimSet, mTopN, Impala::Core::Table::Table::SetEmpty(), Impala::Core::Table::Table::SetSize(), Shot2Key(), Impala::Core::Vector::Similarity(), and Impala::Core::Table::Table::Size().

00087     {
00088         // ORK: temporarily disabled to find bugs.
00089         // && mSimSet->GetRankTable(0)->Size() >= mTopN) // SK: only skip recalc if sufficient results are available
00090             
00091         if (shot == mOrigin) {
00092             ILOG_DEBUG("SetOrigin: " << shot << " length: " << mTopN << " NO RECALC");
00093             return;
00094         }
00095 
00096         int key = Shot2Key(shot);
00097         Quid quid = mKeyframes->GetQuidFrame(key);
00098         ILOG_DEBUG("SetOrigin: " << shot << " key=" << key << " quid=" <<
00099                    quid << " length: " << mTopN);
00100         //ILOG_STARTACTION("computing visual similarity", ILOG_LEVEL_DEBUG);
00101         Table::SimilarityTableSet::SimTableType* sTable =
00102             mSimSet->GetSimTable(0);
00103         Real64* sim = sTable->GetColumn1()->GetData();
00104         Vector::Similarity(sim, mFeatureTable->FindFeature(quid),
00105                            mFeatureTable->GetColumn2(), 0, 1,
00106                            Vector::Norm1Dist<Real64>);
00107         sTable->SetSize(mFeatureTable->Size());
00108         int nr = Min(mFeatureTable->Size(), mTopN);
00109         mSimSet->ComputeRanksTopN(nr, false);
00110 
00111         // cache these results:
00112         mShotsCache->SetEmpty();
00113         std::map<int,bool> noduplicates;
00114         Table::SimilarityTableSet::RankTableType* ranktable = mSimSet->GetRankTable(0);
00115         Table::SimilarityTableSet::SimTableType* scoretable = mSimSet->GetSimTable(0);
00116         for (int i = 0; i < nr; i ++)
00117         {
00118             Quid thisresult = ranktable->Get1(i);
00119             int keyframe = mKeyframes->GetFrameId(thisresult);
00120             Real64 score = scoretable->Get1(mSimSet->FindQuid(thisresult));
00121 
00122             if (keyframe < 0)
00123                 continue;
00124 
00125             int shot = mKeyframes->GetShotId(keyframe);
00126 
00127             if (shot >= 0 &&
00128                 noduplicates.find(shot) == noduplicates.end())
00129             {
00130                 mShotsCache->Add(shot, i, score);
00131                 noduplicates[shot] = true;
00132             }
00133         }
00134         //ILOG_ENDACTION("computing visual similary");
00135         mOrigin = shot;
00136     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:26:33 2010 for ImpalaSrc by  doxygen 1.5.1