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

virtual void Impala::Core::VideoSet::IndexFeaturesSubset::HandleDoneFile ( VideoSet vs,
int  fileId,
Stream::RgbDataSrc src 
) [inline, virtual]

Completed given DB_FILE in a "normal" walk.

Reimplemented from Impala::Core::VideoSet::Listener.

Definition at line 59 of file IndexFeaturesSubset.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Capacity(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Core::Feature::FeatureTable::GetFeatureVectorLength(), mAnnoQuidTab, mAnnoTabSize, mbInitialize, mDef, mQuidList, mTable, mVerbose, mWalkType, Impala::Core::Table::Read(), and Impala::Core::Table::Select().

00060     {
00061         String fName = vs->GetFilePathFeatureData(mWalkType, mDef,
00062                                                   fileId, false, -1, false,
00063                                                   false);
00064         if (fName.empty())
00065         {
00066             return;
00067         }
00068         Feature::FeatureTable tmp(mDef);
00069         Table::Read(&tmp, fName, vs->GetDatabase());
00070         if (mTable == 0)
00071         {
00072             mTable = new Feature::FeatureTable(mDef, 0,
00073                                                tmp.GetFeatureVectorLength());
00074         }
00075 
00076         // only read quid list once
00077         if (!mbInitialize)
00078         {
00079             mAnnoQuidTab = new Core::Table::QuidTable;
00080             //mQuidList = "Annotations/Genre/concepts_4genre.txt/HomeHighResolution_pos.tab";
00081             Core::Table::Read(mAnnoQuidTab, mQuidList, vs->GetDatabase());
00082 
00083             mAnnoTabSize = mAnnoQuidTab->Capacity();
00084 
00085             mbInitialize = true;
00086         }
00087 
00088         int nFeatureTabSize = tmp.Capacity();
00089 
00090         bool* mask = new bool[nFeatureTabSize];
00091         int nMatched = 0;
00092 
00093         // loop for each keyframe feature vectors
00094         for (int i=0; i<nFeatureTabSize; i++)
00095         {
00096             Quid q = tmp.Get1(i);
00097 
00098             bool bMatched = false;
00099             
00100             // loop for all annotation tables
00101             for (int j=0; j<mAnnoTabSize; j++)
00102             {
00103                 Quid q2 = mAnnoQuidTab->Get1(j);
00104 
00105                 if (q == q2)
00106                 {
00107                     bMatched = true;
00108                     break;
00109                 }
00110             }
00111 
00112             // set the mask file
00113             if (bMatched)
00114             {
00115                 mask[i] = true;
00116                 nMatched ++;
00117             }
00118             else
00119             {
00120                 mask[i] = false;
00121             }
00122         }
00123 
00124         if (mVerbose)
00125         {
00126             std::cout << vs->GetFile(fileId) << " Mask: " << nMatched << " positives (out of ";
00127             std::cout << nFeatureTabSize << ")" << std::endl;
00128             for (int k=0; k<nFeatureTabSize; k++)
00129                 std::cout << mask[k];
00130             std::cout << std::endl;
00131         }
00132         
00133         Table::Select(mTable, &tmp, mask, false);
00134 
00135         delete []mask;
00136 
00137     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:29:43 2010 for ImpalaSrc by  doxygen 1.5.1