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

void Impala::Core::Feature::InterestPointFeature::SetCodebook ( String  filename,
const Persistency::Locator locator 
) [inline]

Definition at line 281 of file InterestPointFeature.h.

References Impala::Core::Feature::FeatureDefinition::AddParameter(), Impala::FileNameBase(), Impala::Core::Feature::FeatureTable::GetFeatureVectorLength(), Impala::CmdOptions::GetInstance(), Impala::Persistency::File::GetReadBuffer(), ILOG_DEBUG, ILOG_ERROR, ILOG_INFO, Impala::MakeString(), Impala::Core::Matrix::MatNrCol(), mCodebook, mDescriptorReduce, mDescriptorReduceFilename, mExtraBoxes, mFeatureDefinition, mLocator, Impala::Core::Feature::ReadCodebookFromBuffer(), Impala::Core::Array::ReadRaw(), Impala::Persistency::RepositoryGetFile(), Impala::Core::Feature::FeatureTable::SetFeatureDefinition(), Impala::Core::Table::Table::Size(), and Impala::StringReplace().

Referenced by Impala::Core::VideoSet::InterestPointProc::HandleNewWalk(), and Impala::Core::ImageSet::InterestPointProc::HandleNewWalk().

00282     {
00283         mLocator = locator;
00284         FileLocator codebookLoc(mLocator, filename);
00285         File file = RepositoryGetFile(codebookLoc, false, false);
00286         Util::IOBuffer* buf = file.GetReadBuffer();
00287         if (!mDescriptorReduceFilename.empty())
00288         {
00289             FileLocator fLoc(mLocator, mDescriptorReduceFilename);
00290             File f = RepositoryGetFile(fLoc, false, false);
00291             ReadRaw(mDescriptorReduce, f);
00292             mFeatureDefinition.AddParameter("red", MakeString(Matrix::MatNrCol(mDescriptorReduce)));
00293         }
00294 
00295         ILOG_DEBUG("SetCodebook after IOBuffer " << buf);
00296         if (!buf)
00297         {
00298             ILOG_ERROR("SetCodebook: IOBuffer is 0");
00299             return;
00300         }
00301         mCodebook = ReadCodebookFromBuffer(buf);
00302         mCodebook->SetFeatureDefinition(FeatureDefinition(filename));
00303         delete buf;
00304         
00305         ILOG_INFO("Reading codebook: " << codebookLoc <<
00306                   "; dimensionCount = " << mCodebook->GetFeatureVectorLength()
00307                   << "; size = " << mCodebook->Size());
00308 
00309         CmdOptions& options = CmdOptions::GetInstance();
00310         String CM = options.GetString("codebookMode");
00311         if(CM != "hard")
00312         {
00313             CM = StringReplace(CM, "llcdump", "llc");
00314             if(CM == "hardindex")
00315             {
00316                 mFeatureDefinition.AddParameter
00317                     ("cm", CM + "-" + FileNameBase(filename));
00318             }
00319             else
00320             {
00321                 mFeatureDefinition.AddParameter("cm", CM);
00322             }
00323         }
00324         if(options.GetString("codebookSigma") != "")
00325         {
00326             mFeatureDefinition.AddParameter
00327                 ("cs", options.GetString("codebookSigma"));
00328         }
00329         if(options.GetString("codebookName") != "")
00330         {
00331             mFeatureDefinition.AddParameter
00332                 ("cn", options.GetString("codebookName"));
00333         }
00334 
00335         if(!options.GetString("extraBoxes").empty())
00336         {
00337             FileLocator fLoc(mLocator, options.GetString("extraBoxes"));
00338             File f = RepositoryGetFile(fLoc, false, false);
00339             ReadRaw(mExtraBoxes, f);
00340         }
00341     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:19:17 2011 for ImpalaSrc by  doxygen 1.5.1