Arrived at a new frame in a "normal" walk.
Reimplemented from Impala::Core::VideoSet::Listener. Definition at line 244 of file LbpEval.h. References Impala::Util::Append(), Impala::atoi(), Impala::Core::Stream::RgbDataSrc::DataPtr(), Impala::Core::Stream::RgbDataSrc::FrameHeight(), Impala::Core::Stream::RgbDataSrc::FrameNr(), Impala::Core::Stream::RgbDataSrc::FrameWidth(), Impala::Core::Feature::FeatureTableSet::GetFeatureDefinition(), GetRectangles(), Impala::Core::Feature::FeatureTableSet::GetTable(), ILOG_DEBUG, ILOG_ERROR, Impala::Core::VideoSet::Lbp(), Impala::Core::Histogram::MakeCooccurenceMatrix(), Impala::Core::Histogram::MakeHistogram1d(), Impala::Core::Feature::MarkovStationaryFeature(), mDoMSF, mMaps, mTableSet, Impala::Core::Histogram::Histogram1dTem< ElemT >::Normalize(), Impala::Core::Array::RGB2Gray(), Impala::Core::Vector::VectorTem< ElemT >::Size(), and Impala::Core::Feature::FeatureTableSet::Size(). 00245 { 00246 Array::Array2dVec3UInt8* im = Array::ArrayCreate<Array::Array2dVec3UInt8> 00247 (src->FrameWidth(), src->FrameHeight(), 0, 0, src->DataPtr(), true); 00248 Array::Array2dScalarReal64* greyim = 0; 00249 Array::RGB2Gray(greyim, im); 00250 delete im; 00251 Quid quid = vs->GetQuidFrame(fileId, src->FrameNr()); 00252 for(int i=0 ; i<mTableSet->Size() ; ++i) 00253 { 00254 Feature::FeatureDefinition fd = mTableSet->GetFeatureDefinition(i); 00255 //ILOG_DEBUG("processing " << fd.AsString()); 00256 int samples = atoi(fd.GetParameterValue("samples")); 00257 int radius = atoi(fd.GetParameterValue("radius")); 00258 Array::Array2dScalarUInt8* lbpIm = 0; 00259 Lbp(lbpIm, greyim, mMaps[i], samples, radius); 00260 00261 //here we could loop over the image parts (patatsnijden) 00262 Vector::VectorTem<Real64> vector; 00263 Vector::VectorTem<Real64>& accu = vector; 00264 std::vector<Geometry::Rectangle> rects; 00265 ILOG_DEBUG("greyim w:"<<lbpIm->CW()<<" h:"<<lbpIm->CH()); 00266 GetRectangles(rects, lbpIm->CW(), lbpIm->CH(), radius); 00267 for(int r=0 ; r<6 ; ++r) 00268 { 00269 ILOG_DEBUG("rect "<<r<<" -> "<<rects[r]); 00270 } 00271 for(int r=0 ; r<6 ; ++r) 00272 { 00273 //either simple histogram, or cooccurence matrix 00274 if(mDoMSF) 00275 { 00276 Histogram::Histogram2dTem<double> hist(-1.5, samples+1.5, samples+2, -1.5, samples+1.5, samples+2); 00277 Histogram::MakeCooccurenceMatrix(&hist, lbpIm, rects[i]); 00278 const Vector::VectorTem<Real64>& v = 00279 Feature::MarkovStationaryFeature(&hist); 00280 accu = Append(accu, v); 00281 } 00282 else 00283 { 00284 double dummy=0; 00285 Histogram::Histogram1dTem<double> hist(-0.5, samples+1.5, samples+2, &dummy); 00286 MakeHistogram1d(&hist, lbpIm, rects[i]); 00287 hist.Normalize(); 00288 if(dummy != 0) 00289 ILOG_ERROR("lbp with map should not create outliers in histogram"); 00290 accu = Append(accu, hist); 00291 } 00292 } 00293 ILOG_DEBUG("feature length: " << accu.Size()); 00294 Feature::FeatureTable* t = mTableSet->GetTable(i); 00295 t->Add(quid, accu); 00296 delete lbpIm; 00297 } 00298 delete greyim; 00299 }
Here is the call graph for this function:
|