Definition at line 130 of file ShotSegmenter.h. References Impala::Core::VideoSet::Mpeg7Doc::AddShot(), Impala::MakeString(), mDoNrkf, mPredictions, mProbThresh, and Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::Value(). Referenced by WriteMp7ShotSeg(). 00132 { 00133 int fractions = 0; 00134 Mpeg7Doc* mp7 = new Mpeg7Doc(id, fileName, nrOfFrames, fractions, true, 00135 "", "", frameRateNum, frameRateDen); 00136 00137 int firstFrameInShot = 0; 00138 int frameAtSemiCut = -1; 00139 int lastFrame = nrOfFrames - 1; 00140 int shotNr = 0; 00141 00142 for (int i = 0; i <= lastFrame; i++) 00143 { 00144 // If the probability is >mProbThresh then there was a cut 00145 // between previous and current frame 00146 if ((mPredictions->Value(i, 0) > mProbThresh) || 00147 (i == lastFrame)) 00148 { 00149 String shotName = "shot" + MakeString(realId + 1) + "_" 00150 + MakeString(shotNr + 1); 00151 std::vector<String> keyNames; 00152 keyNames.push_back(shotName + "_RKF"); 00153 if (frameAtSemiCut != -1) 00154 keyNames.push_back(shotName + "_NRKF"); 00155 std::vector<int> keyFrames; 00156 if (frameAtSemiCut == -1) 00157 { 00158 keyFrames.push_back((firstFrameInShot + i) / 2); 00159 } 00160 else 00161 { 00162 keyFrames.push_back((firstFrameInShot + frameAtSemiCut) / 2); 00163 keyFrames.push_back((frameAtSemiCut + i) / 2); 00164 } 00165 mp7->AddShot(shotName, firstFrameInShot, i, keyNames, keyFrames); 00166 firstFrameInShot = i + 1; 00167 frameAtSemiCut = -1; 00168 shotNr++; 00169 } 00170 else if (mDoNrkf && 00171 (mPredictions->Value(i, 0) > 0.8 * mProbThresh) && 00172 (i - firstFrameInShot > 25)) 00173 { 00174 frameAtSemiCut = i; 00175 } 00176 } 00177 return mp7; 00178 }
Here is the call graph for this function:
|