#include <iostream>
using namespace cv;
using namespace std;
static void help()
{
cout << "This program demonstrates finding the minimum enclosing box, triangle or circle of a set\n"
<< "of points using functions: minAreaRect() minEnclosingTriangle() minEnclosingCircle().\n"
<< "Random points are generated and then enclosed.\n\n"
<< "Press ESC, 'q' or 'Q' to exit and any other key to regenerate the set of points.\n\n";
}
int main( int , char** )
{
help();
for(;;)
{
int i, count = rng.
uniform(1, 101);
vector<Point> points;
for( i = 0; i < count; i++ )
{
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);
}
float radius = 0;
for( i = 0; i < count; i++ )
for( i = 0; i < 4; i++ )
for( i = 0; i < 3; i++ )
imshow(
"Rectangle, triangle & circle", img );
if( key == 27 || key == 'q' || key == 'Q' )
break;
}
return 0;
}