Attach the perimeter to the polygons.
Change-Id: Ic278b68e2e0481d88869946a08588651e884a882
diff --git a/y2019/vision/global_calibration.cc b/y2019/vision/global_calibration.cc
index 6d4a21e..3d1e91f 100644
--- a/y2019/vision/global_calibration.cc
+++ b/y2019/vision/global_calibration.cc
@@ -158,15 +158,15 @@
target_finder.PreFilter(&imgs);
constexpr bool verbose = false;
- ::std::vector<std::vector<Segment<2>>> raw_polys;
+ ::std::vector<Polygon> raw_polys;
for (const RangeImage &blob : imgs) {
// Convert blobs to contours in the corrected space.
ContourNode *contour = target_finder.GetContour(blob);
- const ::std::vector<::Eigen::Vector2f> unwarped_contour =
+ ::std::vector<::Eigen::Vector2f> unwarped_contour =
target_finder.UnWarpContour(contour);
- const ::std::vector<Segment<2>> polygon =
- target_finder.FillPolygon(unwarped_contour, verbose);
- if (!polygon.empty()) {
+ const Polygon polygon =
+ target_finder.FindPolygon(::std::move(unwarped_contour), verbose);
+ if (!polygon.segments.empty()) {
raw_polys.push_back(polygon);
}
}