End of a "normal" walk.
Reimplemented from Impala::Core::VideoSet::Listener. Definition at line 184 of file IndexAnnotation.h. References Impala::FileNameBase(), Impala::Core::Table::AnnotationTableSet::GetLabel(), Impala::Core::VideoSet::Keyframes::GetNrKeyframes(), Impala::Core::VideoSet::Segmentation::GetNrShots(), ILOG_INFO, mAnnoExtra, mAnnoFrame, mAnnoShot, mConceptExtra, mConceptSet, mKeyframes, mQuidExtra, mSegmentation, mTotalNrAnno, mTotalNrAnnoPos, mTotalNrFrames, mTotalNrFramesPos, mTotalNrSingleFrame, mTotalNrSingleFramePos, Impala::Core::Table::AnnotationTableSet::SaveTables(), Impala::Core::Table::AnnotationTableSet::Size(), Impala::Core::Table::Sort(), and Impala::Core::Table::Write(). 00185 { 00186 Persistency::AnnotationTableSetLocator loc(vs->GetLocator(), 0, 00187 mConceptSet); 00188 for (int c=0 ; c<mAnnoShot->Size() ; c++) 00189 { 00190 String concept = mAnnoShot->GetLabel(c); 00191 int nrShot = mTotalNrAnno[c] - mTotalNrSingleFrame[c]; 00192 double avg = (double) mTotalNrFrames[c] / nrShot; 00193 if (nrShot == 0) 00194 avg = 1; 00195 ILOG_INFO("Indexed " << mTotalNrAnno[c] << " annotations for " 00196 << concept); 00197 ILOG_INFO("total of " << mTotalNrSingleFrame[c] << " frames and " 00198 << nrShot << " shots with avg length of " << avg); 00199 nrShot = mTotalNrAnnoPos[c] - mTotalNrSingleFramePos[c]; 00200 avg = (double) mTotalNrFramesPos[c] / nrShot; 00201 if (nrShot == 0) 00202 avg = 1; 00203 ILOG_INFO("postives: total of " << mTotalNrSingleFramePos[c] << 00204 " frames and " << nrShot << " shots with avg length of " 00205 << avg); 00206 } 00207 if (mSegmentation) 00208 { 00209 ILOG_INFO("Number of shots " << mSegmentation->GetNrShots()); 00210 ILOG_INFO("Saving shot annotations"); 00211 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00212 mAnnoShot->SaveTables(vs, mConceptSet, true); 00213 #else // REPOSITORY_USED 00214 Persistency::AnnotationTableSetRepository().Add(loc, mAnnoShot); 00215 #endif // REPOSITORY_USED 00216 } 00217 if (mKeyframes) 00218 { 00219 ILOG_INFO("Number of keyframes " << mKeyframes->GetNrKeyframes()); 00220 ILOG_INFO("Saving keyframe annotations"); 00221 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00222 mAnnoFrame->SaveTables(vs, mConceptSet, true); 00223 #else // REPOSITORY_USED 00224 Persistency::AnnotationTableSetRepository().Add(loc, mAnnoFrame); 00225 #endif // REPOSITORY_USED 00226 } 00227 if (mAnnoExtra) 00228 { 00229 ILOG_INFO("Saving extra annotations"); 00230 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00231 mAnnoExtra->SaveTables(vs, mConceptExtra, true); 00232 #else // REPOSITORY_USED 00233 loc.SetConceptSet(mConceptExtra); 00234 Persistency::AnnotationTableSetRepository().Add(loc, mAnnoExtra); 00235 #endif // REPOSITORY_USED 00236 ILOG_INFO("Sorting and saving quids"); 00237 Table::Sort(mQuidExtra, 1, true); 00238 String qName = FileNameBase(mConceptExtra) + "_quids.tab"; 00239 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00240 String fName = vs->GetFilePathAnnotation(qName, true, false); 00241 if (!fName.empty()) 00242 Table::Write(mQuidExtra, fName, vs->GetDatabase(), true); 00243 #else // REPOSITORY_USED 00244 Persistency::QuidTableLocator qLoc(vs->GetLocator(), "Annotations", 00245 qName); 00246 Persistency::QuidTableRepository().Add(qLoc, mQuidExtra); 00247 #endif // REPOSITORY_USED 00248 } 00249 }
Here is the call graph for this function:
|