Put all the thresholding code in the same place
This will make it easier to write tests validating the fast version.
Change-Id: I27cc372cc848c495d10a138b3c149d550dc0dad9
diff --git a/y2019/vision/target_finder.cc b/y2019/vision/target_finder.cc
index e340702..82611f3 100644
--- a/y2019/vision/target_finder.cc
+++ b/y2019/vision/target_finder.cc
@@ -11,13 +11,14 @@
aos::vision::RangeImage TargetFinder::Threshold(aos::vision::ImagePtr image) {
const uint8_t threshold_value = GetThresholdValue();
- return aos::vision::DoThreshold(image, [&](aos::vision::PixelRef &px) {
- if (px.g > threshold_value && px.b > threshold_value &&
- px.r > threshold_value) {
- return true;
- }
- return false;
- });
+ return aos::vision::ThresholdImageWithFunction(
+ image, [&](aos::vision::PixelRef px) {
+ if (px.g > threshold_value && px.b > threshold_value &&
+ px.r > threshold_value) {
+ return true;
+ }
+ return false;
+ });
}
// Filter blobs on size.