title: Removal of noisy pixels using opencv
body: <p>I am trying to detect text from an input image using openCV.
  For that I need to remove the noise components from the image. The criteria for that which am using is that if the pixel count of certain component is less than 15 am eliminating that particular component.</p>
  
  <p>e.g suppose the below given images are provided as i/p to the function:
  <img src="https://i.stack.imgur.com/6JfpQ.png" alt="input image 1"></p>
  
  <p><img src="https://i.stack.imgur.com/W4pmy.png" alt="Input image 2"></p>
  
  <p>As it can be seen both the images contain a lot of unwanted noisy pixels, specially the first one.</p>
  
  <p>So if anyone can suggest a feasible way for achieving it, it would be highly appreciated.</p>