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

void Impala::Application::Repository::DoIndexAnnotatedFeatures (  ) 

Definition at line 2014 of file mainRepository.cpp.

References GetAnnotationTableSetLocator(), Impala::CmdOptions::GetArg(), Impala::Persistency::AnnotationTableSetLocator::GetConceptSet(), Impala::Persistency::FeatureLocator::GetContainer(), Impala::CmdOptions::GetInstance(), Impala::Persistency::Locator::GetProtocolAndHost(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::Database::MakeRawDataSet(), Impala::QUID_CLASS_IMAGE, Impala::QuidClass(), Impala::QuidSet(), Impala::Persistency::FeatureLocator::SetContainer(), Impala::Core::Vector::VectorTem< ElemT >::Size(), and Impala::Core::Table::Sort().

Referenced by mainRepository().

02015 {
02016     ILOG_VAR(Impala.Application.Repository.DoIndexAnnotatedFeatures);
02017     CmdOptions& options = CmdOptions::GetInstance();
02018 
02019     AnnotationTableSetLocator aLoc = GetAnnotationTableSetLocator(options, true);
02020     AnnotationTableSet* tSet = AnnotationTableSetRepository().Get(aLoc);
02021     if (tSet == 0)
02022         return;
02023 
02024     int a = 5;
02025     String featureDef = options.GetArg(a++);
02026     ILOG_INFO("FeatureDef = " << featureDef);
02027 
02028     QuidTable* quids = tSet->GetUniqueQuids();
02029     ILOG_INFO("Read " << quids->Size() << " quids, starting sort...");
02030     Sort(quids, 1, true);
02031     ILOG_INFO("Found " << quids->Size() << " unique quids");
02032 
02033     int lastClassId = -1;
02034     int lastSetId = -1;
02035     int lastContainerNr = -1;
02036     RawDataSet* dataSet = 0;
02037     FeatureLocator fLoc;
02038     FeatureTable* features = 0;
02039     FeatureTable* result = 0;
02040     String locString = aLoc.GetProtocolAndHost();
02041     for (int i=0 ; i<quids->Size() ; i++)
02042     {
02043         Quid q = quids->Get1(i);
02044         if ((lastClassId != QuidClass(q)) || (lastSetId != QuidSet(q)))
02045         {
02046             if (dataSet)
02047                 delete dataSet;
02048             lastClassId = QuidClass(q);
02049             lastSetId = QuidSet(q);
02050             dataSet = Core::Database::MakeRawDataSet(locString, q);
02051             ILOG_INFO("i=" << i << ": new dataset " << dataSet->GetSetName());
02052             String walk = (QuidClass(q) == QUID_CLASS_IMAGE) ? "" : "Keyframes";
02053             fLoc = FeatureLocator(dataSet->GetLocator(), false,
02054                                   false, walk, featureDef, "<empty>");
02055             lastContainerNr = -1;
02056         }
02057 
02058         int containerNr = dataSet->GetContainerNrOfQuid(q);
02059         if (lastContainerNr != containerNr)
02060         {
02061             lastContainerNr = containerNr;
02062             String container = dataSet->GetContainer(lastContainerNr);
02063             ILOG_INFO("i=" << i << ": new container " << container);
02064             fLoc.SetContainer(container);
02065             if (features)
02066                 delete features;
02067             features = FeatureTableRepository().Get(fLoc);
02068         }
02069         FeatureTable::VectorReal64 vec = features->FindFeature(q);
02070         if (result == 0)
02071         {
02072             result = new FeatureTable(features->GetFeatureDefinition(),
02073                                       quids->Size(), vec.Size());
02074         }
02075         result->Add(q, vec);
02076     }
02077     if (features)
02078         delete features;
02079     if (dataSet)
02080         delete dataSet;
02081     if (result == 0)
02082     {
02083         ILOG_ERROR("No features found");
02084         return;
02085     }
02086     if (result->Size() != quids->Size())
02087     {
02088         ILOG_ERROR("Found " << result->Size() << " features for " <<
02089                    quids->Size() << " quids");
02090     }
02091     delete quids;
02092 
02093     FeatureLocator rLoc(aLoc, false, true, aLoc.GetConceptSet(), featureDef, "");
02094     FeatureTableRepository().Add(rLoc, result);
02095     delete result;
02096 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:15:49 2011 for ImpalaSrc by  doxygen 1.5.1