Definition at line 1126 of file mainUtil.cpp. References Impala::Core::Vector::AddAssign(), Impala::Core::Vector::DivAssign(), Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetNrArg(), ILOG_ERROR, ILOG_VAR, Impala::Core::VideoSet::MakeVideoSet(), and Impala::Core::Vector::MulAssign(). Referenced by mainUtil(). 01127 { 01128 #ifndef REPOSITORY_TODO 01129 typedef Core::VideoSet::VideoSet VideoSet; 01130 typedef Core::Table::SimilarityTableSet SimilarityTableSet; 01131 typedef Core::Table::SimilarityTableSet::SimTableType SimTableType; 01132 01133 ILOG_VAR(Impala.Application.Util.DoCombineConcepts); 01134 CmdOptions& options = CmdOptions::GetInstance(); 01135 if (options.GetNrArg() < 7) 01136 { 01137 ILOG_ERROR("Need more parameters"); 01138 return; 01139 } 01140 String vidSetName = options.GetArg(1); 01141 String conceptSet = options.GetArg(2); 01142 String model = options.GetArg(3); 01143 String resultName = options.GetArg(4); 01144 String combi = options.GetArg(5); 01145 if ((combi != "mul") && (combi != "avg")) 01146 { 01147 ILOG_ERROR("Unknown combination method : " << combi); 01148 return; 01149 } 01150 std::vector<String> featureDefs; 01151 for (int i=6 ; i<options.GetNrArg() ; i++) 01152 featureDefs.push_back(options.GetArg(i)); 01153 01154 VideoSet* vidSet = Core::VideoSet::MakeVideoSet(vidSetName); 01155 01156 SimilarityTableSet* combinedSet = SimilarityTableSet::MakeFromFile 01157 (vidSet, conceptSet, model, featureDefs[0]); 01158 for (int i=1 ; i<featureDefs.size() ; i++) 01159 { 01160 SimilarityTableSet* simSet = SimilarityTableSet::MakeFromFile 01161 (vidSet, conceptSet, model, featureDefs[i]); 01162 for (int t=0 ; t<simSet->NrTables() ; t++) 01163 { 01164 if (combi == "mul") 01165 MulAssign(combinedSet->GetSimTable(t)->GetColumn1(), 01166 simSet->GetSimTable(t)->GetColumn1(), 0, -1); 01167 else 01168 AddAssign(combinedSet->GetSimTable(t)->GetColumn1(), 01169 simSet->GetSimTable(t)->GetColumn1(), 0, -1); 01170 } 01171 delete simSet; 01172 } 01173 if (combi == "avg") 01174 for (int t=0 ; t<combinedSet->NrTables() ; t++) 01175 DivAssign(combinedSet->GetSimTable(t)->GetColumn1(), 01176 featureDefs.size(), 0, -1); 01177 combinedSet->ComputeRanks(true); 01178 combinedSet->Save(vidSet, conceptSet, model, resultName, true); 01179 delete combinedSet; 01180 delete vidSet; 01181 #endif 01182 }
Here is the call graph for this function:
|