Lower the exposure when we see lots of bright pixels.
This is deterministic, so we will see the field repeatably. When this
was random, we were randomly getting different targets depending on
which mode it was in.
Change-Id: I3d8dddeadab9527b3824b0bfbf25c88ecff9de22
diff --git a/y2019/vision/target_finder.h b/y2019/vision/target_finder.h
index 0f1575c..d54dc2d 100644
--- a/y2019/vision/target_finder.h
+++ b/y2019/vision/target_finder.h
@@ -41,6 +41,8 @@
// Value against which we threshold.
static uint8_t GetThresholdValue() { return 100; }
+ int PixelCount(BlobList *imgs);
+
// filter out obvious or durranged blobs.
void PreFilter(BlobList *imgs);
@@ -72,7 +74,7 @@
bool verbose);
bool TestExposure(const std::vector<IntermediateResult> &results,
- int *desired_exposure);
+ int pixel_count, int *desired_exposure);
// Get the local overlay for debug if we are doing that.
aos::vision::PixelLinesOverlay *GetOverlay() { return &overlay_; }
@@ -108,6 +110,8 @@
size_t frame_count_;
size_t valid_result_count_;
+ int close_bucket_ = 0;
+
int current_exposure_ = 0;
};