Definition at line 1485 of file mainUtil.cpp. References Impala::Core::Vector::AddAssign(), Impala::Core::Vector::DivAssign(), Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetInstance(), Impala::Core::Database::RawDataSet::GetLocator(), Impala::CmdOptions::GetNrArg(), ILOG_ERROR, ILOG_VAR, Impala::Core::VideoSet::MakeVideoSet(), and Impala::Core::Vector::MulAssign(). Referenced by mainUtil(). 01486 { 01487 typedef Core::VideoSet::VideoSet VideoSet; 01488 typedef Core::Table::SimilarityTableSet SimilarityTableSet; 01489 typedef Core::Table::SimilarityTableSet::SimTableType SimTableType; 01490 01491 ILOG_VAR(Impala.Application.Util.DoCombineConcepts); 01492 CmdOptions& options = CmdOptions::GetInstance(); 01493 if (options.GetNrArg() < 7) 01494 { 01495 ILOG_ERROR("Need more parameters"); 01496 return; 01497 } 01498 String vidSetName = options.GetArg(1); 01499 String conceptSet = options.GetArg(2); 01500 String model = options.GetArg(3); 01501 String resultName = options.GetArg(4); 01502 String combi = options.GetArg(5); 01503 if ((combi != "mul") && (combi != "avg")) 01504 { 01505 ILOG_ERROR("Unknown combination method : " << combi); 01506 return; 01507 } 01508 std::vector<String> featureDefs; 01509 for (int i=6 ; i<options.GetNrArg() ; i++) 01510 featureDefs.push_back(options.GetArg(i)); 01511 01512 VideoSet* vidSet = Core::VideoSet::MakeVideoSet(vidSetName); 01513 01514 SimilarityTableSetLocator loc(vidSet->GetLocator(), true, "", conceptSet, 01515 model, featureDefs[0], ""); 01516 SimilarityTableSet* combinedSet = SimilarityTableSetRepository().Get(loc); 01517 for (int i=1 ; i<featureDefs.size() ; i++) 01518 { 01519 loc.SetFeature(featureDefs[i]); 01520 SimilarityTableSet* simSet = SimilarityTableSetRepository().Get(loc); 01521 for (int t=0 ; t<simSet->NrTables() ; t++) 01522 { 01523 if (combi == "mul") 01524 MulAssign(combinedSet->GetSimTable(t)->GetColumn1(), 01525 simSet->GetSimTable(t)->GetColumn1(), 0, -1); 01526 else 01527 AddAssign(combinedSet->GetSimTable(t)->GetColumn1(), 01528 simSet->GetSimTable(t)->GetColumn1(), 0, -1); 01529 } 01530 delete simSet; 01531 } 01532 if (combi == "avg") 01533 for (int t=0 ; t<combinedSet->NrTables() ; t++) 01534 DivAssign(combinedSet->GetSimTable(t)->GetColumn1(), 01535 featureDefs.size(), 0, -1); 01536 combinedSet->ComputeRanks(true); 01537 loc.SetFeature(resultName); 01538 SimilarityTableSetRepository().Add(loc, combinedSet); 01539 delete combinedSet; 01540 delete vidSet; 01541 }
Here is the call graph for this function: ![]()
|