Fill in contours to avoid holes in blobs

Prevents us from detecting multiple blobs in one.
Also don't require more green than blue because of glare.
Combining these two removes holes in all the images from bellarmine.

Signed-off-by: Milind Upadhyay <milind.upadhyay@gmail.com>
Change-Id: I761957e81f0ac5ba9fbc6a82ee57e32d40cbed5f
diff --git a/y2022/vision/blob_detector.cc b/y2022/vision/blob_detector.cc
index aaa22f6..873cf43 100644
--- a/y2022/vision/blob_detector.cc
+++ b/y2022/vision/blob_detector.cc
@@ -13,7 +13,7 @@
 
 DEFINE_uint64(red_delta, 100,
               "Required difference between green pixels vs. red");
-DEFINE_uint64(blue_delta, 30,
+DEFINE_uint64(blue_delta, 1,
               "Required difference between green pixels vs. blue");
 
 DEFINE_bool(use_outdoors, false,
@@ -52,6 +52,14 @@
     }
   }
 
+  // Fill in the contours on the binarized image so that we don't detect
+  // multiple blobs in one
+  const auto blobs = FindBlobs(binarized_image);
+  for (auto it = blobs.begin(); it < blobs.end(); it++) {
+    cv::drawContours(binarized_image, blobs, it - blobs.begin(),
+                     cv::Scalar(255), cv::FILLED);
+  }
+
   return binarized_image;
 }