From c3dee2839466a1b9f9b1b514ddb9ecd27db3fd6a Mon Sep 17 00:00:00 2001 From: StevenPuttemans Date: Wed, 17 Jul 2013 15:21:23 +0200 Subject: [PATCH 1/2] Fixed bug #3101, problem on ellipse2poly function --- modules/core/src/drawing.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/core/src/drawing.cpp b/modules/core/src/drawing.cpp index 9e3340897..fa0c5cf17 100644 --- a/modules/core/src/drawing.cpp +++ b/modules/core/src/drawing.cpp @@ -888,9 +888,10 @@ void ellipse2Poly( Point center, Size axes, int angle, pt.y = cvRound( cy + x * beta + y * alpha ); if( pt != prevPt ) pts.push_back(pt); + prevPt = pt; } - if( pts.size() < 2 ) + if( pts.size() == 1 ) pts.push_back(pts[0]); } From dd0481ef2df420bc8d3393ee6a57d07b46a3d691 Mon Sep 17 00:00:00 2001 From: StevenPuttemans Date: Thu, 18 Jul 2013 15:34:38 +0200 Subject: [PATCH 2/2] Added brackets around line 888-892 for correct code! --- modules/core/src/drawing.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/core/src/drawing.cpp b/modules/core/src/drawing.cpp index fa0c5cf17..144fa964f 100644 --- a/modules/core/src/drawing.cpp +++ b/modules/core/src/drawing.cpp @@ -886,9 +886,10 @@ void ellipse2Poly( Point center, Size axes, int angle, Point pt; pt.x = cvRound( cx + x * alpha - y * beta ); pt.y = cvRound( cy + x * beta + y * alpha ); - if( pt != prevPt ) + if( pt != prevPt ){ pts.push_back(pt); prevPt = pt; + } } if( pts.size() == 1 )