Home || Visual Search || Applications || Architecture || 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 138 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, mInterestPointFeature, mNoZIP, mOptions, mSkipThisVideo, mTempFilenames, Impala::PathJoin(), Impala::StringReplace(), and Impala::StringReplaceAll().

00139     {
00140         if (mSkipThisVideo)
00141             return;
00142         // get frame and friendly frame name
00143         Array::Array2dVec3UInt8* im = Array::ArrayCreate<Array::Array2dVec3UInt8>
00144             (src->FrameWidth(), src->FrameHeight(), 0, 0, src->DataPtr(), true);
00145         String videoName = src->GetName();
00146         String::size_type p = videoName.rfind("/");
00147         if (p != String::npos)
00148             videoName = videoName.substr(p+1, videoName.size());
00149 
00150         String imName = FileNameCtor(videoName, "frame", src->FrameNr(), "");
00151         imName = StringReplaceAll(imName, ".", "_");
00152 
00153         // verify image is not null
00154         if (!im)
00155         {
00156             ILOG_ERROR("No image: fileId=" << fileId << "; imName=" << imName);
00157             return;
00158         }
00159 
00160         // create temporary output filename
00161         String outputFilename = PathJoin(GetTmpPath(), imName + "." +
00162                                          mInterestPointFeature.GetFeatureName());
00163 
00164         // clean up the filename: remove .jpg and ./ paths
00165         outputFilename = StringReplace(outputFilename, ".jpg", "");
00166         outputFilename = StringReplace(outputFilename, "/./", "/");
00167         outputFilename = StringReplace(outputFilename, "/./", "/");
00168         ILOG_DEBUG("fileId=" << fileId << "; imName=" << imName <<
00169                    "; outputFilename=" << outputFilename);
00170         
00171         // compute feature
00172         if (mNoZIP)
00173         {
00174             outputFilename = "";
00175         }
00176         mInterestPointFeature.mClusterInputImage =
00177             QuidObj(vs->GetQuidFrame(fileId, src->FrameNr())).ToString();
00178 
00179         if (!mInterestPointFeature.FindInterestPoints(mOptions, im, 
00180                vs->GetQuidFrame(fileId, src->FrameNr()), outputFilename, true))
00181         {
00182             ILOG_ERROR("Extracting interest points/descriptors failed: " <<
00183                        imName);
00184         }
00185 
00186         // post-processing functionality
00187         if (mOptions.GetString("interestPointPostProcess") != "")
00188         {
00189             String cmd = mOptions.GetString("interestPointPostProcess")
00190                 + " " + outputFilename;
00191             ILOG_INFO("Post-processing = " << cmd);
00192             system(cmd.c_str());
00193         }
00194         if (!mNoZIP)
00195         {
00196             mTempFilenames.push_back(outputFilename);
00197         }
00198 
00199         delete im;
00200     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:21:58 2011 for ImpalaSrc by  doxygen 1.5.1