An example using the convexHull functionality
#include <iostream>
static void help(char** argv)
{
cout << "\nThis sample program demonstrates the use of the convexHull() function\n"
<< "Call:\n"
<< argv[0] << endl;
}
int main( int argc, char** argv )
{
{
help(argv);
return 0;
}
for(;;)
{
int i, count = (unsigned)rng%100 + 1;
vector<Point> points;
for( i = 0; i < count; i++ )
{
points.push_back(pt);
}
vector<int> hull;
for( i = 0; i < count; i++ )
int hullcount = (int)hull.size();
Point pt0 = points[hull[hullcount-1]];
for( i = 0; i < hullcount; i++ )
{
Point pt = points[hull[i]];
pt0 = pt;
}
if( key == 27 || key == 'q' || key == 'Q' )
break;
}
return 0;
}