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

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

Arrived at a new frame in a "normal" walk.

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

Definition at line 127 of file InterestPointProc.h.

References Impala::Core::Stream::RgbDataSrc::DataPtr(), Impala::FileNameCtor(), Impala::Core::Feature::InterestPointFeature::FindInterestPoints(), Impala::Core::Stream::RgbDataSrc::FrameHeight(), Impala::Core::Stream::RgbDataSrc::FrameNr(), Impala::Core::Stream::RgbDataSrc::FrameWidth(), Impala::Core::Feature::InterestPointFeature::GetFeatureName(), Impala::Core::Stream::RgbDataSrc::GetName(), Impala::CmdOptions::GetString(), Impala::GetTmpPath(), ILOG_DEBUG, ILOG_ERROR, ILOG_INFO, Impala::Core::Feature::InterestPointFeature::mClusterInputImage, mFeatureTables, mInterestPointFeature, Impala::Core::Feature::InterestPointFeature::mLastCodebookVectors, mNoZIP, mOptions, mSkipThisVideo, mTemporaryFilenames, Impala::PathJoin(), Impala::StringReplace(), and Impala::StringReplaceAll().

00128     {
00129         if(mSkipThisVideo) return;
00130         // get frame and friendly frame name
00131         Array::Array2dVec3UInt8* im = Array::ArrayCreate<Array::Array2dVec3UInt8>
00132             (src->FrameWidth(), src->FrameHeight(), 0, 0, src->DataPtr(), true);
00133         String videoName = src->GetName();
00134         String::size_type p = videoName.rfind("/");
00135         if (p != String::npos)
00136             videoName = videoName.substr(p+1, videoName.size());
00137 
00138         String imName = FileNameCtor(videoName, "frame", src->FrameNr(), "");
00139         imName = StringReplaceAll(imName, ".", "_");
00140 
00141         // verify image is not null
00142         if (!im) {
00143             ILOG_ERROR("No image: fileId=" << fileId << "; imName=" << imName);
00144             return;
00145         }
00146 
00147         // create temporary output filename
00148         String outputFilename = PathJoin(GetTmpPath(), imName + "." + mInterestPointFeature.GetFeatureName());
00149 
00150         // clean up the filename: remove .jpg and ./ paths
00151         outputFilename = StringReplace(outputFilename, ".jpg", "");
00152         outputFilename = StringReplace(outputFilename, "/./", "/");
00153         outputFilename = StringReplace(outputFilename, "/./", "/");
00154         ILOG_DEBUG("fileId=" << fileId << "; imName=" << imName << "; outputFilename=" << outputFilename);
00155         
00156         // compute feature
00157         if(mNoZIP) {
00158             outputFilename = "";
00159         }
00160         mInterestPointFeature.mClusterInputImage = QuidObj(vs->GetQuidFrame(fileId, src->FrameNr())).ToString();
00161 
00162         if(!mInterestPointFeature.FindInterestPoints(mOptions, im, 
00163                vs->GetQuidFrame(fileId, src->FrameNr()), outputFilename, true))
00164         {
00165             ILOG_ERROR("Extracting interest points/descriptors failed: " << imName);
00166         }
00167 
00168         if(mInterestPointFeature.mLastCodebookVectors.size() != 0) {
00169             // we have a projected feature vector
00170             if(mFeatureTables.size() < mInterestPointFeature.mLastCodebookVectors.size()) {
00171                 // first valid vector: allocate the table
00172                 for(int i = mFeatureTables.size(); i < mInterestPointFeature.mLastCodebookVectors.size(); i++) {
00173                     mFeatureTables.push_back(new Feature::FeatureTable(mInterestPointFeature.GetFeatureName(), 500, mInterestPointFeature.mLastCodebookVectors[i]->Size()));
00174                 }
00175             }
00176             for(int i = 0; i < mInterestPointFeature.mLastCodebookVectors.size(); i++) {
00177                 Quid quid = vs->GetQuidFrame(fileId, src->FrameNr());
00178                 mFeatureTables[i]->Add(quid, *mInterestPointFeature.mLastCodebookVectors[i]);
00179             }
00180         }
00181 
00182         // post-processing functionality
00183         if(mOptions.GetString("interestPointPostProcess") != "") {
00184             String cmd = mOptions.GetString("interestPointPostProcess") + " " + outputFilename;
00185             ILOG_INFO("Post-processing = " << cmd);
00186             system(cmd.c_str());
00187         }
00188         if(!mNoZIP) {
00189             mTemporaryFilenames.push_back(outputFilename);
00190         }
00191 
00192         delete im;
00193     }

Here is the call graph for this function:


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