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 216 of file Collection.h. References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Add(), Impala::atol(), 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, and Impala::Persistency::File::ReadStrings(). Referenced by WriteVideoSet(). 00218 { 00219 std::vector<String> lines; 00220 Persistency::FileLocator loc(clipsKeys); 00221 typedef Persistency::RepositoryInFileSystem FS; 00222 Persistency::File file = FS::GetInstance().GetFile(loc, false, false); 00223 file.ReadStrings(std::back_inserter(lines), true); 00224 ILOG_DEBUG("clipsKeys nr lines = " << lines.size()); 00225 int curShot = -1; 00226 int lastShot = -1; 00227 for (int i=0 ; i<lines.size() ; i++) 00228 { 00229 Util::StringParser p(lines[i]); 00230 int frameNr = atol(FileNameBase(p.GetString(' '))); 00231 int vidId = atol(p.GetString('_')); 00232 if (vidId - 1 < offset) 00233 { 00234 ILOG_DEBUG("skipping " << vidId - 1); 00235 continue; 00236 } 00237 int shotId = atol(p.GetString('_')); 00238 int shotSub = atol(p.GetString(' ')); 00239 String imName = FileNameTail(p.GetString(' ')); 00240 ILOG_DEBUG("frameNr = " << frameNr << ", vid = " << vidId << 00241 ", shot = " << shotId << ", imName = " << imName); 00242 if (shotId != lastShot) 00243 { 00244 curShot++; 00245 lastShot = shotId; 00246 if (curShot > segm->GetNrShots()) 00247 { 00248 ILOG_ERROR("Too many keyframes"); 00249 return; 00250 } 00251 } 00252 if ((vidId - 1 - offset) != segm->GetVideoId(curShot)) 00253 ILOG_ERROR("ReadKeyframesClips: wrong vidId on line" << i); 00254 if ((frameNr < segm->GetStart(curShot)) || 00255 (frameNr > segm->GetEnd(curShot))) 00256 { 00257 ILOG_ERROR("ReadKeyframesClips: frame " << frameNr << 00258 " outside shot [" << segm->GetStart(curShot) 00259 << "," << segm->GetEnd(curShot) << "], line nr = " 00260 << i << ", curshot = " << curShot); 00261 } 00262 keyframes->Add(vidId - 1 - offset, curShot, frameNr, imName); 00263 } 00264 }
Here is the call graph for this function:
|