Remove all using directives for STL namespace and members
Made all STL usages explicit to be able automatically find all usages of particular class or function.
This commit is contained in:
@@ -138,7 +138,7 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out
|
||||
|
||||
vect[i].x = (float)dx;
|
||||
vect[i].y = (float)dy;
|
||||
inv_vect_length[i] = (float)(1./sqrt(dx*dx + dy*dy));
|
||||
inv_vect_length[i] = (float)(1./std::sqrt(dx*dx + dy*dy));
|
||||
|
||||
pt0 = pt;
|
||||
}
|
||||
@@ -321,10 +321,10 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out
|
||||
|
||||
out[0] = px;
|
||||
out[1] = py;
|
||||
|
||||
|
||||
out[2] = A1 * buf[2];
|
||||
out[3] = B1 * buf[2];
|
||||
|
||||
|
||||
out[4] = A2 * buf[4];
|
||||
out[5] = B2 * buf[4];
|
||||
}
|
||||
@@ -336,7 +336,7 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -345,35 +345,35 @@ cv::RotatedRect cv::minAreaRect( InputArray _points )
|
||||
Mat hull;
|
||||
Point2f out[3];
|
||||
RotatedRect box;
|
||||
|
||||
|
||||
convexHull(_points, hull, true, true);
|
||||
|
||||
|
||||
if( hull.depth() != CV_32F )
|
||||
{
|
||||
Mat temp;
|
||||
hull.convertTo(temp, CV_32F);
|
||||
hull = temp;
|
||||
}
|
||||
|
||||
|
||||
int n = hull.checkVector(2);
|
||||
const Point2f* hpoints = (const Point2f*)hull.data;
|
||||
|
||||
|
||||
if( n > 2 )
|
||||
{
|
||||
rotatingCalipers( hpoints, n, CALIPERS_MINAREARECT, (float*)out );
|
||||
box.center.x = out[0].x + (out[1].x + out[2].x)*0.5f;
|
||||
box.center.y = out[0].y + (out[1].y + out[2].y)*0.5f;
|
||||
box.size.width = (float)sqrt((double)out[1].x*out[1].x + (double)out[1].y*out[1].y);
|
||||
box.size.height = (float)sqrt((double)out[2].x*out[2].x + (double)out[2].y*out[2].y);
|
||||
box.size.width = (float)std::sqrt((double)out[1].x*out[1].x + (double)out[1].y*out[1].y);
|
||||
box.size.height = (float)std::sqrt((double)out[2].x*out[2].x + (double)out[2].y*out[2].y);
|
||||
box.angle = (float)atan2( (double)out[1].y, (double)out[1].x );
|
||||
}
|
||||
else if( n == 2 )
|
||||
{
|
||||
box.center.x = (hpoints[0].x + hpoints[1].x)*0.5f;
|
||||
box.center.y = (hpoints[0].y + hpoints[1].y)*0.5f;
|
||||
double dx = hpoints[1].x - hpoints[0].x;
|
||||
double dx = hpoints[1].x - hpoints[0].x;
|
||||
double dy = hpoints[1].y - hpoints[0].y;
|
||||
box.size.width = (float)sqrt(dx*dx + dy*dy);
|
||||
box.size.width = (float)std::sqrt(dx*dx + dy*dy);
|
||||
box.size.height = 0;
|
||||
box.angle = (float)atan2( dy, dx );
|
||||
}
|
||||
@@ -382,7 +382,7 @@ cv::RotatedRect cv::minAreaRect( InputArray _points )
|
||||
if( n == 1 )
|
||||
box.center = hpoints[0];
|
||||
}
|
||||
|
||||
|
||||
box.angle = (float)(box.angle*180/CV_PI);
|
||||
return box;
|
||||
}
|
||||
|
Reference in New Issue
Block a user