Changes to aos/vision/debug in preparation for the competition.
- blob_log-source: Support multiple key-commands for seeking to a target
also added JustCheckForTarget which can be implemented to run faster
for slow computer (will implement in followup).
- camera-source + debug_framework: Takes in camera parameters from the
caller.
- debug_window -> Scale text up on smaller monitors.
- overlay.h: Ben changed width to measure point to point on the cross.
And added circles to the pixel-lines overlay.
- tcp-source: Drop packects when the computer can't keep up.
- debug_framework -> detect smaller monitors and scale down the viewport.
Change-Id: Iae65a0799231d006b38694a8a9cb3894e252033c
diff --git a/aos/vision/debug/debug_framework.h b/aos/vision/debug/debug_framework.h
index 2f0fcd1..e838913 100644
--- a/aos/vision/debug/debug_framework.h
+++ b/aos/vision/debug/debug_framework.h
@@ -4,6 +4,7 @@
#include "aos/common/util/global_factory.h"
#include "aos/vision/blob/range_image.h"
#include "aos/vision/events/epoll_events.h"
+#include "aos/vision/image/camera_params.pb.h"
#include "aos/vision/image/image_types.h"
namespace aos {
@@ -27,6 +28,17 @@
// One frame worth of blobs. Returns if the frame is "interesting".
virtual bool HandleBlobs(BlobList imgs, ImageFormat fmt) = 0;
+
+ // One frame worth of blobs. Returns if the frame is "interesting".
+ // Fast version that does no drawing.
+ virtual bool JustCheckForTarget(BlobList imgs, ImageFormat fmt) {
+ return HandleBlobs(std::move(imgs), fmt);
+ }
+
+ // Register key press handler.
+ virtual std::function<void(uint32_t)> RegisterKeyPress() {
+ return std::function<void(uint32_t)>();
+ }
};
// For ImageSource implementations only. Allows registering key press events
@@ -39,13 +51,21 @@
key_press_events_.emplace_back(std::move(key_press_event));
}
- virtual void NewJpeg(DataRef data) = 0;
+ // The return value bool here for all of these is
+ // if the frame is "interesting" ie has a target.
+ virtual bool NewJpeg(DataRef data) = 0;
- virtual void NewBlobList(BlobList blob_list, ImageFormat fmt) = 0;
+ virtual bool NewBlobList(BlobList blob_list, ImageFormat fmt) = 0;
+
+ virtual bool JustCheckForTarget(BlobList imgs, ImageFormat fmt) = 0;
// Expose a EpollLoop to allow waiting for events.
virtual aos::events::EpollLoop *Loop() = 0;
+ virtual const CameraParams &camera_params() = 0;
+
+ virtual BlobStreamViewer *viewer() = 0;
+
protected:
const std::vector<std::function<void(uint32_t)>> &key_press_events() {
return key_press_events_;
@@ -77,7 +97,8 @@
// Runs loop and never returns.
// Feeds into a generic filter.
-void DebugFrameworkMain(int argc, char **argv, FilterHarness *filter);
+void DebugFrameworkMain(int argc, char **argv, FilterHarness *filter,
+ CameraParams camera_params);
} // namespace vision
} // namespace aos