mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
imgproc: remove redundant fabs() in fitEllipseDirect
In fitEllipseDirect, `double det = fabs(cv::determinant(M))` applies fabs() unnecessarily since the next line `if (fabs(det) > 1.0e-10)` already takes the absolute value. Remove the outer fabs() to avoid the redundant operation.
This commit is contained in:
@@ -750,7 +750,7 @@ cv::RotatedRect cv::fitEllipseDirect( InputArray _points )
|
||||
M(2,1) = (DM(0,1) + (DM(0,3)*TM(0,1) + DM(0,4)*TM(1,1) + DM(0,5)*TM(2,1))/Ts)/2.;
|
||||
M(2,2) = (DM(0,2) + (DM(0,3)*TM(0,2) + DM(0,4)*TM(1,2) + DM(0,5)*TM(2,2))/Ts)/2.;
|
||||
|
||||
double det = fabs(cv::determinant(M));
|
||||
double det = cv::determinant(M);
|
||||
if (fabs(det) > 1.0e-10)
|
||||
break;
|
||||
eps = (float)(s/(n*2)*1e-2);
|
||||
|
||||
Reference in New Issue
Block a user