Skip to content

fitEllipse #4515

@opencv-pushbot

Description

@opencv-pushbot

Transferred from http://code.opencv.org/issues/2836

|| Jens Breitenbach on 2013-02-26 14:50
|| Priority: Normal
|| Affected: 2.4.3
|| Category: imgproc, video
|| Tracker: Bug
|| Difficulty: None
|| PR: 
|| Platform: None / None

fitEllipse

Making contour processing in some rare cases (<10%) fitEllipse will cause bad results. Example:

> oMatFloatPoints = (Mat_<float>(12,2) << 327,317,  328,316,  329,315,  330,314,  331,314,  332,314,  333,315,  333,316, 333,317,  333,318, 333,319, 333,320);
> 
> oEliBox = fitEllipse(oMatFloatPoints);

It fails if rp[2] < rp[3]! The bug appears also with much longer contours. See the examples and my proposed fix I attached.

History

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions