Multiple functions for polygon drawing (Feature #2573)


Added by Michael Burdinov over 12 years ago. Updated over 9 years ago.


Status:Open Start date:2012-11-26
Priority:Low Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:3.0
Difficulty: Pull request:

Description

fillPoly, polylines, and drawContours are designed to do the same task: draw set of polygons in image. They have minor differences but it is still unclear why there 3 functions instead of one. There no documentation that compare them, so I don't even know whether each one has its own implementation or they share some code.

Kirill Kornyakov:
Suggestion is to get rid of two of them and to stay with only one.


History

Updated by Kirill Kornyakov over 12 years ago

OK, but what exactly is needed here?

If the one is interested in inter-dependency of this functions, he can read the code. If you want to see some explanation in the documentation, then please point which pages should be updated and with which text. It is also possible that you could make a pull request to the documentation, to simplify the whole procedure. OpenCV project doesn't have a dedicated technical writer, so it may take forever...

  • Target version set to Next Hackathon
  • Category changed from core to documentation
  • Assignee changed from Vadim Pisarevsky to Michael Burdinov

Updated by Michael Burdinov over 12 years ago

This is not issue of documentation (at least not only documentation). Someone has to decide which one of the 3 functions is the most correct / has best interface / fastest / is supported / and so on. Two other functions should be deprecated. Or maybe some new interface should be created that will unify all 3 interfaces, and existing ones will all be depricated. I just pointed out that having 3 different functions with nearly identical functionality is very confusing. At least I don't know the answer to the question: which function should be used.

Updated by Kirill Kornyakov over 12 years ago

OK, let Vadim decide. Functions are indeed quite similar, so we'll probably get rid of some of them during the next restucturing.

Here are functions' signatures to think about:

void polylines(Mat& img, const Point** pts, const int* npts, int ncontours, bool isClosed, const Scalar& color, int thickness=1, int lineType=8, int shift=0 )
void  fillPoly(Mat& img, const Point** pts, const int* npts, int ncontours, const Scalar& color, int lineType=8, int shift=0, Point offset=Point() )
void drawContours(InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=noArray(), int maxLevel=INT_MAX, Point offset=Point() )
  • Description changed from fillPoly, polylines, and drawContours are designed to do the same task: draw ... to fillPoly, polylines, and drawContours are designed to do the same task: draw ... More
  • Target version changed from Next Hackathon to 3.0
  • Category changed from documentation to core
  • Priority changed from Normal to Low
  • Assignee changed from Michael Burdinov to Vadim Pisarevsky
  • Tracker changed from Patch to Feature

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4456

Also available in: Atom PDF