title: How to automatically detect and fill a closed region using opencv?
body: <p>All I have is the following bitmap:
  <img src="https://i.stack.imgur.com/W6jKq.png" alt="original contours image">
  What I'm gonna do is to fill the contour automatically like the following:
  <img src="https://i.stack.imgur.com/IudhF.png" alt="filled">
  It's kind like the fill function in MS Painter. The initial contours will not cross the boundary of the image.</p>
  
  <p>I don't have a good idea yet. Is there any method in OpenCV can do this? or any suggestions?</p>
  
  <p>Thanks in advance!</p>