title: OpenCV: How can I remove unwanted blobs or how can I copy wanted parts into an empty image?
body: <p><em>From the following image, how could I find the result image?</em></p>
  
  <p><a href="https://i.stack.imgur.com/g0cVU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g0cVU.png" alt="enter image description here"></a></p>
  
  <p>The images shown here are threshold images. I have tried using morphological operators but they even remove the blob I want. How could I solve this problem?
  Any hints?</p>
  
  <p><em>Following is the result image I am interested to get/find:</em></p>
  
  <p><a href="https://i.stack.imgur.com/dQJTa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dQJTa.png" alt="enter image description here"></a></p>
  
  <pre><code>import cv2
  diff = cv2.imread('Image.png',0)
  ret, thresh = cv2.threshold(diff, 12.5, 255, cv2.THRESH_BINARY)
  thresh = cv2.dilate(thresh, None, iterations = 1)
  cv2.imshow('img', thresh) # This is the  first picture I have shown
  cv2.waitKey(0)
  </code></pre>