Definition at line 403 of file TrackerBackFore.h. References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::H(), Impala::Core::Geometry::Rectangle::Height(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::mBH, Impala::Core::Geometry::Rectangle::mBottom, Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::mBW, Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::mCH, Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::mCW, mInput, Impala::Core::Geometry::Rectangle::mLeft, mPosition, Impala::Core::Geometry::Rectangle::mRight, Impala::Core::Geometry::Rectangle::mTop, Impala::Core::Array::Pattern::PatSet(), Impala::Core::Array::SetVal(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::W(), and Impala::Core::Geometry::Rectangle::Width(). Referenced by SearchObject(). 00404 { 00407 00408 00409 // first cheat with the sizes of the searchArea 00410 int w = searchArea->W(); 00411 int h = searchArea->H(); 00412 searchArea->mBW = 0; 00413 searchArea->mBH = 0; 00414 searchArea->mCW = w; 00415 searchArea->mCH = h; 00416 SetVal(searchArea, searchArea, 0); 00417 int x = mPosition.mLeft + mPosition.Width()/2; 00418 int y = mPosition.mTop + mPosition.Height()/2; 00419 00420 // see if the search area lies partially outside the image 00421 Core::Geometry::Rectangle overflow; 00422 if (x - bw - 10 < 0) 00423 overflow.mLeft = -(x - bw - 10); 00424 if (y - bh - 10 < 0) 00425 overflow.mTop = -(y - bh - 10); 00426 if (x + bw + 10 >= mInput->CW()) 00427 overflow.mRight = x + bw + 10 - mInput->CW() + 1; 00428 if (y + bh + 10 >= mInput->CH()) 00429 overflow.mBottom = y + bh + 10 - mInput->CH() + 1; 00430 00431 // copy the data 00432 Array::Pattern::PatSet 00433 (searchArea, mInput, 00434 x - bw - 10 + overflow.mLeft, 00435 y - bh - 10 + overflow.mTop, 00436 2*bw + 21 - (overflow.mLeft + overflow.mRight), 00437 2*bh + 21 - (overflow.mTop + overflow.mBottom), 00438 0, 0); 00439 00440 // restore correct dimensions 00441 searchArea->mCW = 21; 00442 searchArea->mCH = 21; 00443 searchArea->mBW = bw; 00444 searchArea->mBH = bh; 00445 }
Here is the call graph for this function:
|