Penalize vision solver based on projected size
This makes the distance much more accurate.
Also, use standard deviation in pixels to compute confidence.
Signed-off-by: Milind Upadhyay <milind.upadhyay@gmail.com>
Change-Id: I53f16100065a2bb75b31e78af057326163265d8e
diff --git a/y2022/vision/blob_detector.h b/y2022/vision/blob_detector.h
index d0a2b85..a60316a 100644
--- a/y2022/vision/blob_detector.h
+++ b/y2022/vision/blob_detector.h
@@ -11,6 +11,9 @@
public:
struct BlobStats {
cv::Point centroid;
+ // Size of the rotated rect fitting around the blob
+ cv::Size size;
+ // Aspect ratio of the non-rotated bounding box
double aspect_ratio;
double area;
size_t num_points;
@@ -20,8 +23,7 @@
cv::Mat binarized_image;
std::vector<std::vector<cv::Point>> filtered_blobs, unfiltered_blobs;
std::vector<BlobStats> blob_stats;
- // In sorted order from left to right on the circle
- std::vector<cv::Point> filtered_centroids;
+ std::vector<BlobStats> filtered_stats;
cv::Point centroid;
};