Changed the semantics of the minEnclosingTriangle function such that:

1. The function receives a set of points as input instead of a convex polygon with more than three vertices
2. The convex hull P is computed inside the function
3.1. If the number of vertices of P is greater than three then the algorithm which was implemented before executes
3.2. Otherwise the vertices of the triangle are picked from the vertices of the given polygon and the area computed
This commit is contained in:
Ovidiu Parvu
2013-09-12 13:29:10 +01:00
parent 510ad8e779
commit 4fce8e6b0e
2 changed files with 46 additions and 28 deletions

View File

@@ -1451,8 +1451,8 @@ CV_EXPORTS_W void boxPoints(RotatedRect box, OutputArray points);
CV_EXPORTS_W void minEnclosingCircle( InputArray points,
CV_OUT Point2f& center, CV_OUT float& radius );
//! computes the minimal enclosing triangle for a convex polygon defined by at least three points
CV_EXPORTS_W void minEnclosingTriangle( InputArray convexPolygon,
//! computes the minimal enclosing triangle for a set of points
CV_EXPORTS_W void minEnclosingTriangle( InputArray points,
CV_OUT OutputArray triangle, CV_OUT double& area );
//! matches two contours using one of the available algorithms