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

void Impala::Core::VideoSet::ShotSegmenter::Predict ( int  PredictFrame  )  [inline]

Definition at line 760 of file ShotSegmenter.h.

References Impala::Core::Vector::ElemMin(), mCentered, mFeatures, mFeaturesReversed, mPredictions, mRadius, mScores, mSvm, mSymmetry, mWindowSize, Impala::Core::Training::Svm::Predict(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::SetValue(), and Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::Value().

Referenced by HandleDoneFile(), and HandleNewFrame().

00761     {
00762         int PredictBase = mCentered? PredictFrame-mRadius : PredictFrame-mRadius+1; 
00763         int size = mCentered ? mWindowSize + 1 : mWindowSize;
00764         if (PredictBase<0)
00765         {
00766             mPredictions->SetValue(0.0, PredictFrame, 0);
00767             return;
00768         }
00769         
00770         //Update the feature vector
00771         for(int i=0;i<size;i++)
00772         {
00773             (*mFeatures)[i]=mScores->Value(PredictBase+i,0);
00774             (*mFeaturesReversed)[size-i-1]=mScores->Value(PredictBase+i,0);
00775             
00776         }
00777 #ifndef REPOSITORY_USED // Here comes the deprecated stuff
00778         if (mSvm)
00779         {
00780             double pf = mSvm->Predict(mFeatures);
00781             double pr = mSvm->Predict(mFeaturesReversed);
00782             double p = 0;
00783 
00784             if(mSymmetry=="None")
00785                 p=pf;
00786             else if(mSymmetry=="Avg")
00787                 p=(pr+pf)/2;
00788             else if(mSymmetry=="Or")
00789                 p= (pf > pr) ? pf : pr;
00790             else if(mSymmetry=="And")
00791                 p= (pf < pr) ? pf : pr;
00792 
00793             
00794             mPredictions->SetValue(1-p,PredictFrame,0);
00795         }
00796         else
00797         {
00798  #endif // REPOSITORY_USED
00799            Real64 minScore = Vector::ElemMin(*mFeatures);
00800             if (mFeatures->Elem(mCentered ? mRadius : mRadius-1) == minScore)
00801             {
00802                 mPredictions->SetValue((4.0-minScore) / 2.0, PredictFrame, 0);
00803             }
00804             else
00805             {
00806                 mPredictions->SetValue(0.0, PredictFrame, 0);
00807             }
00808 #ifndef REPOSITORY_USED // Here comes the deprecated stuff
00809         }
00810 #endif // REPOSITORY_USED
00811     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:32:18 2010 for ImpalaSrc by  doxygen 1.5.1