Missing/incompelte documentation of cv::floodFill (Bug #3763)


Added by Thomas Seidl over 10 years ago. Updated almost 10 years ago.


Status:Done Start date:2014-06-20
Priority:Low Due date:
Assignee:Thomas Seidl % Done:

0%

Category:documentation
Target version:2.4.12 Estimated time:0.25 hour
Affected version:2.4.9 (latest release) Operating System:Any
Difficulty:Easy HW Platform:Any
Pull request:https://github.com/Itseez/opencv/pull/2738

Description

The method cv::floodFill is documented here:
http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html#floodfill

The explanation for the "flags" parameter misses some information about floodfill into
a mask image. There is no explanation how you can set the color, which should be used
to fill the mask.
The color needs to be specified in the "flags" parameter, due to the intensity value,
which gets left-shifted 8-bits, e.g.

flags = 4 | CV_FLOODFILL_MASK_ONLY | (255 << 8)

means, that for filling a 4-neighbourhood connectivity is used, the result is filled into
the maskimage and the filled region, will get the value 255.

I got the solution for my problem from this forum page:
http://stackoverflow.com/questions/16705721/opencv-floodfill-with-mask

The whole stuff is explained there very well.


Associated revisions

Revision 0a5df016
Added by Vadim Pisarevsky about 10 years ago

Merge pull request #3763 from laomaiweng:patch-1

History

Updated by Sebastien Kramm over 10 years ago

Update on the same function:

The return value (int) is undocumented.

From reading the (old: 2.4.5) code, it appears to return the area of the connected component.
The corresponding doc file is /modules/imgproc/doc/miscellaneous_transformations.rst
but I'm not sure how this must be described.

Updated by Steven Puttemans over 10 years ago

I suggest you go and give it a try by submitting a pull request. Someone will get assigned to it and help you reach the best explanation possible.
Starting from the guide you mentioned it shouldn't be that hard to explain.

Updated by Dmitry Retinskiy over 10 years ago

  • Status changed from New to Open
  • Assignee set to Thomas Seidl

Updated by Maksim Shabunin almost 10 years ago

Some clarification has been added in PR https://github.com/Itseez/opencv/pull/2738, merged into both master and 2.4

  • Status changed from Open to Done
  • Target version set to 2.4.12
  • Pull request set to https://github.com/Itseez/opencv/pull/2738

Also available in: Atom PDF