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

void Impala::Persistency::SimilarityTableSetRepositoryInMonet::LoadSim ( SimilarityTableSet res,
int  tableIdx,
const SimilarityTableSetLocator loc 
) [inline, private]

Definition at line 88 of file SimilarityTableSetRepositoryInMonet.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Add(), Impala::FileNameBase(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Persistency::SimilarityTableSetLocator::GetConceptSet(), Impala::Persistency::RepositoryInMonetDB::GetConnection(), Impala::Persistency::SimilarityTableSetLocator::GetContainer(), Impala::Persistency::Locator::GetDataSet(), Impala::Persistency::SimilarityTableSetLocator::GetFeature(), Impala::Core::Database::RawDataSet::GetFileId(), Impala::Persistency::SimilarityTableSetLocator::GetModel(), Impala::Core::Table::SimilarityTableSet::GetName(), Impala::Core::VideoSet::VideoSet::GetQuidFrame(), Impala::Core::Table::SimilarityTableSet::GetQuidTable(), Impala::Core::VideoSet::VideoSet::GetQuidVideo(), Impala::Core::Table::SimilarityTableSet::GetSimTable(), ILOG_ERROR, Impala::MakeString(), and RepMonet().

Referenced by LoadSims().

00090     {
00091         Connection* conn = RepMonet().GetConnection(loc);
00092 
00093         String vidSetBase = FileNameBase(loc.GetDataSet());
00094         String conceptSetBase = FileNameBase(loc.GetConceptSet());
00095         String concept = res->GetName(tableIdx);
00096 
00097         Core::VideoSet::VideoSet* vidSet = VideoSetRepository().Get(loc);
00098         int fileIdx = vidSet->GetFileId(loc.GetContainer());
00099         Quid vidQuid = vidSet->GetQuidVideo(fileIdx, false);
00100 
00101         String query =
00102             "select fr.fragment_start, s.confidence \
00103              from video_sets vss, video_set vs, keyword_sets kss, \
00104                   keyword_set ks, keyword k, model_sets_name msn, \
00105                   model_sets mss, model_ref mr, \
00106                   file f, fragment fr, score s \
00107              where vss.set_name = '" + vidSetBase + "' and \
00108                    kss.set_name = '" + conceptSetBase + "' and \
00109                    kss.video_sets_id = vss.video_sets_id and \
00110                    msn.set_name = '" + loc.GetFeature() + "' and \
00111                    mss.model_sets_name_id = msn.model_sets_name_id and \
00112                    k.keyword_name = '" + concept + "' and \
00113                    ks.keyword_sets_id = kss.keyword_sets_id and \
00114                    ks.keyword_id = k.keyword_id and \
00115                    mr.model_name = '" + loc.GetModel() + "' and \
00116                    mr.keyword_set_id = ks.keyword_set_id and \
00117                    mr.model_ref_id = mss.model_ref_id and \
00118                    vs.video_sets_id = vss.video_sets_id and \
00119                    f.file_id = vs.file_id and \
00120                    f.quid = " + MakeString(vidQuid) + " and \
00121                    fr.media_id = f.media_id and \
00122                    fr.fragment_length = 1 and \
00123                    fr.keyframe = false and \
00124                    s.fragment_id = fr.fragment_id and \
00125                    s.model_sets_id = mss.model_sets_id and \
00126                    s.file_id = f.file_id \
00127              order by fr.fragment_start;";
00128 
00129         MapiHdl hdl = conn->QueryPartStart(query);
00130         if (hdl == 0)
00131             return;
00132 
00133         int* start = 0;
00134         int startSize = 0;
00135         if (!conn->QueryPartFetchInt(hdl, 0, start, startSize))
00136             return;
00137 
00138         double* sims = 0;
00139         int simSize = 0;
00140         if (!conn->QueryPartFetchDouble(hdl, 1, sims, simSize))
00141             return;
00142 
00143         conn->QueryPartEnd(hdl);
00144 
00145         SimTableType* simTab = res->GetSimTable(tableIdx);
00146         QuidTable* quidTab = res->GetQuidTable();
00147         for (int i=0 ; i<startSize ; i++)
00148         {
00149             simTab->Add(sims[i]);
00150             Quid q = vidSet->GetQuidFrame(fileIdx, start[i], true);
00151             if (tableIdx == 0)
00152             {
00153                 quidTab->Add(q);
00154             }
00155             else
00156             {
00157                 if (quidTab->Get1(i) != q)
00158                 {
00159                     ILOG_ERROR("Quid mismatch");
00160                 }
00161             }
00162         }
00163 
00164         delete start;
00165         delete sims;
00166     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:23:43 2011 for ImpalaSrc by  doxygen 1.5.1