title: Edge Smoothing and filling inner contours in opencv with iOS
body: <p>I am trying to tan human skin with different intensity with help of opencv. I have already identified human skin and changing color tone of those pixels. But it is not smooth. </p>
  
  <p><img src="https://i.stack.imgur.com/oboMF.png" alt="ScreenShot 1"></p>
  
  <p>Top left - original image
  Top right - saturation channel of original image
  Bottom left - Gray scale mask identifying locations of skin on original image
  Bottom right - result image with color tone changed of pixels located in mask.</p>
  
  <p>Now my problem is that, in mask image some gap is left because of variation on color tone or brightness in original image. And that is why those portion is missed in result image. Can anyone tell me how can I fill the small gaps in mask image? </p>
  
  <p><img src="https://i.stack.imgur.com/GmBnA.png" alt="Gaps in mask image"></p>
  
  <p>Another if someone can help me out for smoothing only edges of my tanned mask will help me a lot. See the reference image below,</p>
  
  <p><img src="https://i.stack.imgur.com/Wlisj.png" alt="Sharp tanned mask edge"></p>
  
  <p>Thanks in advance.</p>