Definition at line 184 of file SimilarityTimeLineVideo.h. References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Core::Table::SimilarityTableSet::GetSimTable(), mAverages, max, mMaxima, mMeans, mSimSet, Impala::Core::Table::SimilarityTableSet::NrTables(), and Impala::Core::Table::SimilarityTableSet::TableSize(). Referenced by SetSimilarityTableSet(). 00185 { 00186 if (!mSimSet) 00187 return; 00188 nFrames += (nFrames%2) ? 1 : 0; 00189 int nFramesDiv2 = nFrames/2; 00190 00191 for (int i=0; i<mSimSet->NrTables(); i++) 00192 { 00193 FloatVector* avgVector = new FloatVector; 00194 SimTableType* simTable = mSimSet->GetSimTable(i); 00195 int tableSize = mSimSet->TableSize(); 00196 double sum = 0.f; 00197 00198 for (int s=0; s<nFrames; s++) 00199 { 00200 sum += simTable->Get1(s); 00201 if (s<nFramesDiv2) 00202 avgVector->push_back((float)(sum/(s+1))); 00203 } 00204 int sz = tableSize - nFramesDiv2; 00205 for (int j=nFramesDiv2; j<sz; j++) 00206 { 00207 sum += simTable->Get1(j+nFramesDiv2); 00208 sum -= simTable->Get1(j-nFramesDiv2); 00209 avgVector->push_back((float)(sum/nFrames)); 00210 } 00211 00212 mAverages.push_back(avgVector); 00213 00214 // Find max and mean 00215 float max = 0.f, val; 00216 sum = 0; 00217 for (int m=nFramesDiv2; m<tableSize-nFramesDiv2; m++) 00218 { 00219 sum += (val = (*avgVector)[m]); 00220 if (val > max) 00221 max = val; 00222 } 00223 float mean = (float) (sum/(tableSize-nFrames)); 00224 mMeans.push_back(mean); 00225 mMaxima.push_back(max); 00226 } 00227 }
Here is the call graph for this function:
|