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/viewer.cc b/y2022/vision/viewer.cc
index 202b6a0..1085aaf 100644
--- a/y2022/vision/viewer.cc
+++ b/y2022/vision/viewer.cc
@@ -122,6 +122,7 @@
LOG(INFO) << ": # blobs: " << filtered_blobs.size() << " (# removed: "
<< unfiltered_blobs.size() - filtered_blobs.size() << ")";
cv::imshow("image", rgb_image);
+ cv::imshow("mask", binarized_image);
cv::imshow("blobs", ret_image);
int keystroke = cv::waitKey(0);