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

void Impala::Core::Trec::Collection::ReadKeyframesClips ( Segmentation segm,
Keyframes keyframes,
String  clipsKeys,
int  offset 
) [inline, private]

Keyframe definition in Clips-Imag format.

File excerpt:

BG_12460/74.jpg 1_1_1 TRECVID2007_1/shot1_1_RKF.jpg 0 128 0 128 0.00 5.16 352 288 BG_12460/406.jpg 1_2_1 TRECVID2007_1/shot1_2_RKF.jpg 129 623 129 623 5.16 24.96 352 288

...

BG_12460/2680.jpg 1_9_1 TRECVID2007_1/shot1_9_NRKF_1.jpg 2675 2685 2675 2988 107.00 107.44 352 288 BG_12460/2883.jpg 1_9_2 TRECVID2007_1/shot1_9_RKF.jpg 2686 2988 2675 2988 107.44 119.56 352 288

Definition at line 238 of file Collection.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Add(), Impala::atol(), Impala::Util::DatabaseReadString(), Impala::FileNameBase(), Impala::FileNameTail(), Impala::Core::VideoSet::Segmentation::GetEnd(), Impala::Core::VideoSet::Segmentation::GetNrShots(), Impala::Core::VideoSet::Segmentation::GetStart(), Impala::Core::VideoSet::Segmentation::GetVideoId(), ILOG_DEBUG, ILOG_ERROR, mDb, and Impala::Persistency::File::ReadStrings().

Referenced by WriteVideoSet().

00240     {
00241         std::vector<String> lines;
00242 #ifndef REPOSITORY_USED // Here comes the deprecated stuff
00243         Util::DatabaseReadString(std::back_inserter(lines), clipsKeys, mDb, true);
00244 #else // REPOSITORY_USED
00245         Persistency::FileLocator loc(clipsKeys);
00246         typedef Persistency::RepositoryInFileSystem FS;
00247         Persistency::File file = FS::GetInstance().GetFile(loc, false, false);
00248         file.ReadStrings(std::back_inserter(lines), true);
00249 #endif // REPOSITORY_USED
00250         ILOG_DEBUG("clipsKeys nr lines = " << lines.size());
00251         int curShot = -1;
00252         int lastShot = -1;
00253         for (int i=0 ; i<lines.size() ; i++)
00254         {
00255             Util::StringParser p(lines[i]);
00256             int frameNr = atol(FileNameBase(p.GetString(' ')));
00257             int vidId = atol(p.GetString('_'));
00258             if (vidId - 1 < offset)
00259             {
00260                 ILOG_DEBUG("skipping " << vidId - 1);
00261                 continue;
00262             }
00263             int shotId = atol(p.GetString('_'));
00264             int shotSub = atol(p.GetString(' '));
00265             String imName = FileNameTail(p.GetString(' '));
00266             ILOG_DEBUG("frameNr = " << frameNr << ", vid = " << vidId <<
00267                        ", shot = " << shotId << ", imName = " << imName);
00268             if (shotId != lastShot)
00269             {
00270                 curShot++;
00271                 lastShot = shotId;
00272                 if (curShot > segm->GetNrShots())
00273                 {
00274                     ILOG_ERROR("Too many keyframes");
00275                     return;
00276                 }
00277             }
00278             if ((vidId - 1 - offset) != segm->GetVideoId(curShot))
00279                 ILOG_ERROR("ReadKeyframesClips: wrong vidId on line" << i);
00280             if ((frameNr < segm->GetStart(curShot)) ||
00281                 (frameNr > segm->GetEnd(curShot)))
00282             {
00283                 ILOG_ERROR("ReadKeyframesClips: frame " << frameNr <<
00284                            " outside shot [" << segm->GetStart(curShot)
00285                            << "," << segm->GetEnd(curShot) << "], line nr = "
00286                            << i << ", curshot = " << curShot);
00287             }
00288             keyframes->Add(vidId - 1 - offset, curShot, frameNr, imName);
00289         }
00290     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:25:28 2010 for ImpalaSrc by  doxygen 1.5.1