Draw target estimate better
Signed-off-by: Milind Upadhyay <milind.upadhyay@gmail.com>
Change-Id: Ia3f2273daecc6a9c763ada58e8003391607e85ce
diff --git a/y2022/vision/blob_detector.cc b/y2022/vision/blob_detector.cc
index 7bbd1f3..aaa22f6 100644
--- a/y2022/vision/blob_detector.cc
+++ b/y2022/vision/blob_detector.cc
@@ -226,6 +226,10 @@
cv::Scalar(0, 100, 0), cv::FILLED);
}
+ for (const auto &blob : blob_result.filtered_blobs) {
+ cv::polylines(view_image, blob, true, cv::Scalar(0, 255, 0));
+ }
+
static constexpr double kCircleRadius = 2.0;
// Draw blob centroids
for (auto stats : blob_result.blob_stats) {
diff --git a/y2022/vision/target_estimator.cc b/y2022/vision/target_estimator.cc
index 130759c..b495b23 100644
--- a/y2022/vision/target_estimator.cc
+++ b/y2022/vision/target_estimator.cc
@@ -440,11 +440,11 @@
double angle_to_camera, double roll, double pitch,
double yaw, double confidence, cv::Mat view_image) {
constexpr int kTextX = 10;
- int text_y = 250;
- constexpr int kTextSpacing = 35;
+ int text_y = 0;
+ constexpr int kTextSpacing = 25;
const auto kTextColor = cv::Scalar(0, 255, 255);
- constexpr double kFontScale = 1.0;
+ constexpr double kFontScale = 0.6;
cv::putText(view_image, absl::StrFormat("Distance: %.3f", distance),
cv::Point(kTextX, text_y += kTextSpacing),