title: With opencv,How to use not erosion/dilation but connectedComponentsWithStas to remove dots?
body: <p>I have read this:</p>
  
  <p><a href="https://stackoverflow.com/questions/30369031/remove-spurious-small-islands-of-noise-in-an-image-python-opencv">Remove spurious small islands of noise in an image - Python OpenCV</a></p>
  
  <p>erosion/dilation are suggested,and just wondering is it possible to do same thing by using connectedComponectsStats?I have googled,got these:</p>
  
  <p><a href="http://www.itkeyword.com/doc/5188188731707068417/how-to-use-opencvs-connected-components-with-stats-in-python" rel="nofollow noreferrer">http://www.itkeyword.com/doc/5188188731707068417/how-to-use-opencvs-connected-components-with-stats-in-python</a></p>
  
  <p><a href="http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_features_harris/py_features_harris.html#corner-with-subpixel-accuracy" rel="nofollow noreferrer">http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_features_harris/py_features_harris.html#corner-with-subpixel-accuracy</a></p>
  
  <p>but from these,I can't figure out how to remove dots,so would you please tell me how to do it,thanks in advance!</p>
  
  <p>update:
  What I really want to do is extracting human shape from blow image by remove small dots.</p>
  
  <p><a href="https://i.stack.imgur.com/nEtCx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nEtCx.png" alt="demo image"></a></p>