code: def detect_blob(self, img, filters):
          
          acc_mask = ones(img.shape[:2], dtype=uint8) * 255
  
          rgb = img.copy()
          hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
  
          for c, (min, max) in filters.items():
              img = rgb if c in 'RGB' else hsv
  
              mask = img[:, :, self.channels[c]]
              mask[mask < min] = 0
              mask[mask > max] = 0
  
              acc_mask &= mask
  
          kernel = ones((5, 5), uint8)
          acc_mask = cv2.dilate(cv2.erode(acc_mask, kernel), kernel)
  
          circles = cv2.HoughCircles(acc_mask, cv2.HOUGH_GRADIENT, 3, img.shape[0] / 5.)
          return circles.reshape(-1, 3) if circles is not None else []
docs: "filters" must be something similar to:
              filters = {
                  'R': (150, 255), # (min, max)
                  'S': (150, 255),
              }