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

ImageSet* Impala::Core::ImageSet::MakeImageSet ( CString  fileName,
Util::Database *  parentDb = 0 
) [inline]

Definition at line 26 of file MakeImageSet.h.

References Impala::FileNameConcat(), Impala::FileNameExt(), Impala::Util::Database::GetFilePath(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::Persistency::Locator::GetProtocolAndHost(), Impala::CmdOptions::GetString(), ILOG_VAR, ILOG_WARN, Impala::StringReplaceAll(), and Impala::StringList::ToString().

Referenced by Impala::Core::Table::Bayes::Bayes(), Impala::Core::Table::ConfusionMatrix::ConfusionMatrix(), Impala::Application::Table::DoScaleFeatureTable(), Impala::Core::VideoSet::ExportKeyframes::ExportKeyframes(), Impala::Core::Training::Factory::Factory(), Impala::Application::WindowTrecSearch::InitDataTrecTopic(), Impala::Application::IDash::TrecEngine::LoadData(), Impala::Core::Trec::TrecTopic::LoadDataSets(), Impala::Samples::mainCoreTest(), Impala::Application::mainImSet(), MakeIxsDocument(), Impala::Core::Database::MakeRawDataSet(), Impala::Core::VideoSet::MakeSegmentationDocument(), Impala::Application::WindowTrecResult::ReadData(), and Impala::Core::ImageSet::Thumbnails::Thumbnails().

00027 {
00028     ILOG_VAR("Impala.Core.ImageSet.MakeImageSet");
00029 
00030     if (fileName.empty())
00031     {
00032         ILOG_WARN("Construction of image set not possible without a file name");
00033         return 0;
00034     }
00035 
00036     CmdOptions& options = CmdOptions::GetInstance();
00037     String ext = FileNameExt(fileName);
00038     ImageSet* imSet;
00039     if (ext == "txt")
00040     {
00041         Util::Database* db = parentDb;
00042         if (db == 0)
00043             db = new Util::Database(fileName);
00044         if (db->GetFilePath("ImageData", fileName, false, false).empty())
00045             return 0;
00046         imSet = new ImageSet(db, fileName, true);
00047         // Make ImageSet also Repository compatible
00048         Persistency::ImageSetLocator loc(fileName, options);
00049         imSet->SetProtocolAndHost(loc.GetProtocolAndHost());
00050         imSet->SetImageSetLocator(loc);
00051     }
00052     else if (ext == "ixs")
00053     {
00054         String setName = options.GetString("imageSet");
00055         Util::Database* db = new Util::Database(setName);
00056         imSet = new ImageSet(db, setName, true);
00057     }
00058     else
00059     {
00060         String fileNameSlashed = StringReplaceAll(fileName, "\\", "/");
00061         StringList pList(fileNameSlashed, '/');
00062         String imName = *(pList.rbegin());
00063         pList.pop_back();
00064         String dirName = *(pList.rbegin());
00065         pList.pop_back();
00066         String section = pList.ToString('/');
00067         Util::Database* db = &Util::Database::GetInstance();
00068         imSet = new ImageSet(db, "tmpSet.txt", false);
00069         imSet->AddFile(imName, FileNameConcat(section, dirName));
00070     }
00071 
00072     if (!imSet)
00073         ILOG_WARN("Construction of image set failed for: " << fileName);
00074     return imSet;
00075 }

Here is the call graph for this function:


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