mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Change condition on parallel ellipse case so can only calculate t if necessary
This commit is contained in:
parent
5a552b6d8d
commit
37f77e7397
@ -446,9 +446,8 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
|
||||
|
||||
// store angle and radii
|
||||
rp[4] = -0.5 * atan2(gfp[2], gfp[1] - gfp[0]); // convert from APP angle usage
|
||||
t = sin(-2.0 * rp[4]);
|
||||
if( fabs(t) > min_eps )
|
||||
t = gfp[2]/t;
|
||||
if( fabs(gfp[2]) > min_eps )
|
||||
t = gfp[2]/sin(-2.0 * rp[4]);
|
||||
else // ellipse is rotated by an integer multiple of pi/2
|
||||
t = gfp[1] - gfp[0];
|
||||
rp[2] = fabs(gfp[0] + gfp[1] - t);
|
||||
|
Loading…
Reference in New Issue
Block a user