title: SimpleBlobDetector - Isolate blobs that are distinct from surrounding
body: <p>I'm using <code>SimpleBlobDetector</code> to locate the decimal dots and other types of punctuation marks, as can be seen in the image below, sometimes the detector picks up blobs out of the solid areas of the text (The bottom of the middle 9), I'm looking for a way to filter out those detections either through the <code>SimpleBlobDetector</code> or in post process.</p>
  
  <p>Is there a way to specify that a blob must be separated from it's background color? Maybe an edge detection method?</p>
  
  <p>Your help is appreciated.</p>
  
  <p>Detector code is:</p>
  
  <pre class="lang-py prettyprint-override"><code>    params = cv2.SimpleBlobDetector_Params()
      params.filterByArea = True
      params.minArea = 30
      params.minThreshold = 50
      params.maxThreshold = 200
      params.filterByConvexity = True
      params.minConvexity = 0.87
      params.filterByColor = True
      detector = cv2.SimpleBlobDetector_create(params)
      detections = detector.detect(img)
  </code></pre>
  
  <p>Output image with detections</p>
  
  <p><a href="https://i.stack.imgur.com/nZTJy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nZTJy.png" alt="Output image with detections"></a>
  Original:</p>
  
  <p><a href="https://i.stack.imgur.com/y1HU4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y1HU4.jpg" alt="Original image"></a></p>