CV_RETR_CCOMP in findContours not returning hierarchy
Closed this issue · 2 comments
justin-segler commented
I noticed that the mode and chain args inside of findContours are hardcoded to be CV_RETR_LIST and CV_CHAIN_APPROX_SIMPLE. However, when the mode is changed to CV_RETR_CCOMP (which should return the hierarchy with sibling and parent-child relationships), it is not returning the full hierarchy.
- Why is the mode and chain hardcoded? These should be arguments to the findContours function.
- Why is CV_RETR_CCOMP returning the same hierarchy output as CV_RETR_LIST?
crawft commented
Were you able to solve this? Also looking to get the hierarchy from findContours...
crawft commented
OK, so you CAN pass integer vals for mode and chain, modes:
CV_RETR_EXTERNAL =0,
CV_RETR_LIST =1,
CV_RETR_CCOMP =2,
CV_RETR_TREE =3,
CV_RETR_FLOODFILL =4