title: How to remove edge noises from an object in an image
body: <p>I created a clothes mask to extract the clothes object from a image, but there are some white noises included in the mask, the following is the illustration (the outside black area is the background).</p>
  
  <p><a href="https://i.stack.imgur.com/t1yfp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t1yfp.jpg" alt=""></a></p>
  
  <p>I want to get rid of the "white" edge noise from the mask, and I have tried using the naive method of checking if the pixel value is >= 240, the result improves but still not perfect, as shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/7f9UV.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7f9UV.jpg" alt=""></a></p>
  
  <p>I want to completely remove the white noise but not sure how to do that. I am using python opencv and would appreciate if anyone could help me on this.</p>
  
  <p>Thanks!</p>