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

void Impala::Core::VideoSet::MakePoints ( int  samples,
int  radius,
Geometry::PointZ *&  points,
double *&  multipliers 
)

Definition at line 67 of file LbpEval.h.

References M_PI, Impala::Core::Geometry::PointR::mX, Impala::Core::Geometry::PointZ::mX, Impala::Core::Geometry::PointR::mY, and Impala::Core::Geometry::PointZ::mY.

Referenced by Lbp().

00068 {
00069     points = new Geometry::PointZ[samples];
00070     multipliers = new double[samples*4];
00071     Geometry::PointR* offsets = new Geometry::PointR[samples];
00072 
00073     double step = 2 * M_PI / samples;
00074     for (unsigned int i=0;i<samples;i++)
00075     {
00076         double tmpX = radius * cos(i * step);
00077         double tmpY = radius * sin(i * step);
00078         points[i].mX = (int)tmpX;
00079         points[i].mY = (int)tmpY;
00080         offsets[i].mX = tmpX - points[i].mX;
00081         offsets[i].mY = tmpY - points[i].mY;
00082         if (offsets[i].mX < 1.0e-10 && offsets[i].mX > -1.0e-10) //rounding error
00083             offsets[i].mX = 0;
00084         if (offsets[i].mY < 1.0e-10 && offsets[i].mY > -1.0e-10) //rounding error
00085             offsets[i].mY = 0;
00086         
00087         if (tmpX < 0 && offsets[i].mX != 0)
00088         {
00089             points[i].mX -= 1;
00090             offsets[i].mX += 1;
00091         }
00092         if (tmpY < 0 && offsets[i].mY != 0)
00093         {
00094             points[i].mY -= 1;
00095             offsets[i].mY += 1;
00096         }
00097 
00098         double dx = 1-offsets[i].mX;
00099         double dy = 1-offsets[i].mY;
00100         multipliers[i*4+0] = dx*dy;
00101         multipliers[i*4+1] = offsets[i].mX*dy;
00102         multipliers[i*4+2] = dx*offsets[i].mY;
00103         multipliers[i*4+3] = offsets[i].mX*offsets[i].mY;
00104     }
00105     delete offsets;
00106 }


Generated on Fri Mar 19 11:28:10 2010 for ImpalaSrc by  doxygen 1.5.1