Merge pull request #17417 from vpisarev:fix_fitellipse
* improved fitEllipse and fitEllipseDirect accuracy in singular or close-to-singular cases (see issue #9923) * scale points using double precision * added normalization to fitEllipseAMS as well; fixed Java test case by raising the tolerance (it's unclear what is the correct result in this case). * improved point perturbation a bit. make the code a little bit more clear * trying to fix Java fitEllipseTest by slightly raising the tolerance threshold * synchronized C++ version of Java's fitEllipse test * removed trailing whitespaces
This commit is contained in:
@@ -797,9 +797,13 @@ public class ImgprocTest extends OpenCVTestCase {
|
||||
|
||||
rrect = Imgproc.fitEllipse(points);
|
||||
|
||||
assertPointEquals(new Point(0, 0), rrect.center, EPS);
|
||||
assertEquals(2.828, rrect.size.width, EPS);
|
||||
assertEquals(2.828, rrect.size.height, EPS);
|
||||
double FIT_ELLIPSE_CENTER_EPS = 0.01;
|
||||
double FIT_ELLIPSE_SIZE_EPS = 0.4;
|
||||
|
||||
assertEquals(0.0, rrect.center.x, FIT_ELLIPSE_CENTER_EPS);
|
||||
assertEquals(0.0, rrect.center.y, FIT_ELLIPSE_CENTER_EPS);
|
||||
assertEquals(2.828, rrect.size.width, FIT_ELLIPSE_SIZE_EPS);
|
||||
assertEquals(2.828, rrect.size.height, FIT_ELLIPSE_SIZE_EPS);
|
||||
}
|
||||
|
||||
public void testFitLine() {
|
||||
|
||||
Reference in New Issue
Block a user