Merged the trunk r8589:8653 - all changes related to build warnings
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
void help()
|
||||
static void help()
|
||||
{
|
||||
cout << "This program demonstrates finding the minimum enclosing box or circle of a set\n"
|
||||
cout << "This program demonstrates finding the minimum enclosing box or circle of a set\n"
|
||||
"of points using functions: minAreaRect() minEnclosingCircle().\n"
|
||||
"Random points are generated and then enclosed.\n"
|
||||
"Call:\n"
|
||||
@@ -21,7 +21,7 @@ int main( int /*argc*/, char** /*argv*/ )
|
||||
help();
|
||||
|
||||
Mat img(500, 500, CV_8UC3);
|
||||
RNG& rng = theRNG();
|
||||
RNG& rng = theRNG();
|
||||
|
||||
for(;;)
|
||||
{
|
||||
@@ -32,25 +32,25 @@ int main( int /*argc*/, char** /*argv*/ )
|
||||
Point pt;
|
||||
pt.x = rng.uniform(img.cols/4, img.cols*3/4);
|
||||
pt.y = rng.uniform(img.rows/4, img.rows*3/4);
|
||||
|
||||
|
||||
points.push_back(pt);
|
||||
}
|
||||
|
||||
|
||||
RotatedRect box = minAreaRect(Mat(points));
|
||||
|
||||
Point2f center, vtx[4];
|
||||
float radius = 0;
|
||||
minEnclosingCircle(Mat(points), center, radius);
|
||||
box.points(vtx);
|
||||
|
||||
|
||||
img = Scalar::all(0);
|
||||
for( i = 0; i < count; i++ )
|
||||
circle( img, points[i], 3, Scalar(0, 0, 255), CV_FILLED, CV_AA );
|
||||
|
||||
for( i = 0; i < 4; i++ )
|
||||
line(img, vtx[i], vtx[(i+1)%4], Scalar(0, 255, 0), 1, CV_AA);
|
||||
|
||||
circle(img, center, cvRound(radius), Scalar(0, 255, 255), 1, CV_AA);
|
||||
|
||||
circle(img, center, cvRound(radius), Scalar(0, 255, 255), 1, CV_AA);
|
||||
|
||||
imshow( "rect & circle", img );
|
||||
|
||||
|
Reference in New Issue
Block a user