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

void Impala::Core::Feature::MakePatch ( Array::Array2dVec3UInt8 *&  patch,
Array::Array2dVec3UInt8 *  img,
int  x,
int  y,
int  pixelsAround 
)

Definition at line 374 of file RegionDescriptor.h.

References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::BH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::BW(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), Impala::Core::Array::MakeRoi(), Impala::Core::Geometry::Rectangle::mBottom, Impala::Core::Geometry::Rectangle::mLeft, Impala::Core::Geometry::Rectangle::mRight, and Impala::Core::Geometry::Rectangle::mTop.

Referenced by CalculateRegionDescriptors().

00376 {
00377     Geometry::Rectangle regionRect(x - pixelsAround, y - pixelsAround,
00378                                    x + pixelsAround, y + pixelsAround);
00379     if((regionRect.mLeft   < - img->BW()) || 
00380        (regionRect.mTop    < - img->BH()) ||
00381        (regionRect.mRight  >= img->CW() + img->BW()) ||
00382        (regionRect.mBottom >= img->CH() + img->BH()) ) {
00383        
00384         //std::cerr << "[WARNING] Decreased pixelsAround to 120 in MakePatch to avoid going beyond borders of image, value was " << pixelsAround << std::endl;
00385         
00386         pixelsAround = 120;    // this should always work
00387         regionRect.mLeft = x - pixelsAround;
00388         regionRect.mTop = y - pixelsAround;
00389         regionRect.mRight = x + pixelsAround;
00390         regionRect.mBottom = y + pixelsAround;
00391         /*
00392         std::cerr << "[WARNING] Segfault possible due to too small border in MakePatch!" << std::endl;
00393         std::cerr << regionRect.mLeft   <<" "<< - img->BW() <<" "<< 
00394                      regionRect.mTop    <<" "<< - img->BH() <<" "<<
00395                      regionRect.mRight  <<" "<< img->CW() + img->BW() <<" "<<
00396                      regionRect.mBottom <<" "<< img->CH() + img->BH() << std::endl;
00397         std::cerr << "x=" << x << " y=" << y << " size=" << pixelsAround << std::endl; */
00398     }
00399     patch = MakeRoi(img, regionRect);
00400 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:08:33 2010 for ImpalaSrc by  doxygen 1.5.1