cv::fitEllipse returns wrong result (Bug #1638)


Added by Thomas Pönitz about 13 years ago. Updated almost 13 years ago.


Status:Done Start date:2012-02-29
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:imgproc, video
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

See example:

std::vector<std::vector<cv::Point>> c = ;

cv::Mat rgb(10, 10, CV_8UC3);
cv::drawContours(rgb, c, -1, cv::Scalar(0, 255, 0));
auto ellipse = cv::fitEllipse(c[0]);
std::cout << "Ellipse size: " << ellipse.size.width << " " << ellipse.size.height << std::endl;
cv::ellipse(rgb, ellipse, cv::Scalar(0, 0, 255));
cv::imwrite("/tmp/test.png", rgb);

Output:

Ellipse size: 0.632456 0.632456


test.png (123 Bytes) Thomas Pönitz, 2012-02-29 03:21 pm


Associated revisions

Revision 4eda1662
Added by Vadim Pisarevsky almost 13 years ago

switched back to FitEllipse algorithm by Dr. Daniel Weiss; improved its accuracy in some cases. It fixes #1638

History

Updated by Alexander Shishkov almost 13 years ago

  • Priority changed from High to Normal
  • Target version deleted ()
  • Category set to imgproc, video

Updated by Ivan Korolev almost 13 years ago

  • Assignee set to Ivan Korolev

Updated by Ivan Korolev almost 13 years ago

  • Assignee deleted (Ivan Korolev)

Updated by Vadim Pisarevsky almost 13 years ago

thanks for the detailed bug report! The problem has been fixed in SVN trunk, r7726

Updated by Vadim Pisarevsky almost 13 years ago

  • Status changed from Open to Done
  • Assignee set to Vadim Pisarevsky

Updated by Alexander Shishkov almost 13 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF