fix ellipse2poly (Bugfix #3101)
Description
Hi OpenCV-Team,
Just happened to get a segmentation fault in ellipse2poly (modules/core/src/drawing.cpp)
Before adding the points to draw to the output pts-vector it is resized to 0 (drawing.cpp, line 873). If now the ellipse to draw isn't valid, e.g. starting angle or ending angle are equal, then the loop won't be executed, no point will be added to the pts-vector and the line 894: pts.push_back(pts[0]);
will result in a segfault.
Sorry that I don't make a pull request (I'm under time pressure right now), however I attached the patch for it.
Another note: I think it makes more sense to let delta to be of type float so that you can have a better resolution. With very clinched ellipses and large images the drawing points might not be connected any more!
Best,
Guanta
Associated revisions
Merge pull request #3101 from akarsakov:ipp_thresh_fix
History
Updated by Kirill Kornyakov over 11 years ago
Guanta, it seems to me if you really want to see this fixed, it would be great to work on a pull request. OpenCV team really needs help right now...
- HW Platform set to Any
- Operating System set to Any
- Affected version changed from 2.4.5 (latest release) to branch '2.4'
- Target version changed from 2.4.6 to Next Hackathon
- Tracker changed from Patch to Bugfix
Updated by Steven Puttemans over 11 years ago
Added pullrequest for the bugfix : https://github.com/Itseez/opencv/pull/1139
Updated by Guanta Alecho over 11 years ago
Steven Puttemans wrote:
Added pullrequest for the bugfix : https://github.com/Itseez/opencv/pull/1139
Thx for the pull request!
Updated by Steven Puttemans over 11 years ago
You are welcome! Will keep you updated once it is merged ;)
Updated by Steven Puttemans over 11 years ago
Hey Guanta, have a look at this, a warning popped up in the last days, which wasn't there before.
You know what could be the reason for this?
List failed tests:
Video_OpticalFlowSimpleFlow.accuracy (12258 ms) : Optical flow estimation RMSE for SimpleFlow algorithm : 0.853567
Too big rmse error : 0.853567 ( >= 0.600000 )
Updated by Steven Puttemans over 11 years ago
Pullrequest merged! The change to float has not been implemented, since no signal was given to actually do it :P
- Assignee deleted (
Vadim Pisarevsky) - % Done changed from 0 to 100
- Status changed from Open to Done
- Target version deleted (
Next Hackathon)