Definition at line 924 of file mainTable.cpp. References Impala::FileNameBase(), Impala::CmdOptions::GetArg(), Impala::Core::Database::RawDataSet::GetDatabase(), Impala::Core::VideoSet::Keyframes::GetFrameId(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), Impala::Core::VideoSet::Keyframes::GetName(), Impala::CmdOptions::GetNrArg(), ILOG_ERROR, ILOG_VAR, Impala::Core::Table::SimilarityTableSet::MakeFromFile(), Impala::Core::VideoSet::MakeVideoSet(), and Impala::Core::VideoSet::VideoSet::QuidToString(). Referenced by mainTable(). 00925 { 00926 typedef Core::Table::SimilarityTableSet SimilarityTableSet; 00927 00928 ILOG_VAR(Impala.Application.Table.DoDumpSimilarityTableSetTrec); 00929 CmdOptions& options = CmdOptions::GetInstance(); 00930 if (options.GetNrArg() < 3) 00931 { 00932 ILOG_ERROR("Need more parameters"); 00933 return; 00934 } 00935 00936 String setName = options.GetArg(1); 00937 Core::VideoSet::VideoSet* vidSet = Core::VideoSet::MakeVideoSet(setName); 00938 Core::VideoSet::Keyframes keyframes(vidSet, "keyframes"); 00939 String path = options.GetArg(2); 00940 SimilarityTableSet* simSet = 00941 Core::Table::SimilarityTableSet::MakeFromFile(path, 00942 vidSet->GetDatabase()); 00943 00944 Core::Table::QuidTable* qTable = simSet->GetQuidTable(); 00945 int start = options.GetInt("start"); 00946 int end = options.GetInt("end"); 00947 if ((end == -1) || (end > qTable->Size())) 00948 end = qTable->Size(); 00949 00950 std::cout << "SimilarityTableSet " << simSet->GetDescription() << std::endl; 00951 for (int t=0 ; t<simSet->NrTables() ; t++) 00952 { 00953 SimilarityTableSet::SimTableType* simTable = simSet->GetSimTable(t); 00954 std::cout << "table " << t << ", name = " << simSet->GetName(t) 00955 << std::endl; 00956 if (simTable->Size() != qTable->Size()) 00957 { 00958 ILOG_ERROR("DumpRanking: simtable size doesn't match"); 00959 continue; 00960 } 00961 String concept = simSet->GetName(t); 00962 for (int i=start ; i<end ; i++) 00963 { 00964 Quid quid = qTable->Get1(i); 00965 //std::cout << i << ", "; 00966 std::cout << concept << ", "; 00967 int keyId = keyframes.GetFrameId(quid); 00968 if (keyId != -1) 00969 std::cout << FileNameBase(keyframes.GetName(keyId)) << ", "; 00970 else 00971 std::cout << vidSet->QuidToString(quid, true) << ", "; 00972 std::cout << simTable->Get1(i) << std::endl; 00973 } 00974 std::cout << std::endl; 00975 } 00976 delete simSet; 00977 }
Here is the call graph for this function:
|