Updates min_enclosing_triangle.cpp

This commit is contained in:
Suleyman TURKMEN
2017-10-08 13:22:13 +03:00
parent 2c1b4f5711
commit b2673a19cf
3 changed files with 17 additions and 29 deletions
+7 -10
View File
@@ -11,10 +11,7 @@ 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"
<< "Call:\n"
<< "./minarea\n"
<< "Using OpenCV v" << CV_VERSION << "\n" << endl;
<< "Press ESC, 'q' or 'Q' to exit and any other key to regenerate the set of points.\n\n";
}
int main( int /*argc*/, char** /*argv*/ )
@@ -40,18 +37,18 @@ int main( int /*argc*/, char** /*argv*/ )
}
// Find the minimum area enclosing bounding box
RotatedRect box = minAreaRect(Mat(points));
Point2f vtx[4];
RotatedRect box = minAreaRect(points);
box.points(vtx);
// Find the minimum area enclosing triangle
vector<Point2f> triangle;
vector<Point> triangle;
minEnclosingTriangle(points, triangle);
// Find the minimum area enclosing circle
Point2f center, vtx[4];
Point2f center;
float radius = 0;
minEnclosingCircle(Mat(points), center, radius);
box.points(vtx);
minEnclosingCircle(points, center, radius);
img = Scalar::all(0);