Fix bugs in blob detector
When passing grayscale images by value, they can't be changed inside a
function. Also, fixed an infinite loop when more than 0 but less than 3
blobs were getting detected.
Signed-off-by: Milind Upadhyay <milind.upadhyay@gmail.com>
Change-Id: I5403d02aa9e3df07800791312f0e18ee81824868
diff --git a/y2022/vision/blob_detector.h b/y2022/vision/blob_detector.h
index f95b217..a0663fd 100644
--- a/y2022/vision/blob_detector.h
+++ b/y2022/vision/blob_detector.h
@@ -45,7 +45,7 @@
const std::vector<BlobStats> &blob_stats, cv::Point centroid);
static void ExtractBlobs(
- cv::Mat rgb_image, cv::Mat binarized_image, cv::Mat blob_image,
+ cv::Mat rgb_image, cv::Mat &binarized_image, cv::Mat blob_image,
std::vector<std::vector<cv::Point>> &filtered_blobs,
std::vector<std::vector<cv::Point>> &unfiltered_blobs,
std::vector<BlobStats> &blob_stats, cv::Point ¢roid);