Split 2022 vision math code into library
This allows it to be used in target estimator and camera reader in a
addition to blob detector. Will be used for comparing size of projected
blobs to detected blobs, as well as for interpolating between localizer
outputs.
Signed-off-by: milind-u <milind.upadhyay@gmail.com>
Change-Id: I80a726e93d638106431614459837e8671bcb7251
diff --git a/y2022/vision/BUILD b/y2022/vision/BUILD
index 599b4ed..0b96539 100644
--- a/y2022/vision/BUILD
+++ b/y2022/vision/BUILD
@@ -97,6 +97,7 @@
":blob_detector_lib",
":calibration_data",
":calibration_fbs",
+ ":geometry_lib",
":target_estimate_fbs",
":target_estimator_lib",
"//aos:flatbuffer_merge",
@@ -124,6 +125,31 @@
)
cc_library(
+ name = "geometry_lib",
+ hdrs = [
+ "geometry.h",
+ ],
+ target_compatible_with = ["@platforms//os:linux"],
+ visibility = ["//y2022:__subpackages__"],
+ deps = [
+ "//aos/util:math",
+ "//third_party:opencv",
+ "@com_github_google_glog//:glog",
+ ],
+)
+
+cc_test(
+ name = "geometry_test",
+ srcs = [
+ "geometry_test.cc",
+ ],
+ deps = [
+ ":geometry_lib",
+ "//aos/testing:googletest",
+ ],
+)
+
+cc_library(
name = "blob_detector_lib",
srcs = [
"blob_detector.cc",
@@ -134,6 +160,7 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//y2022:__subpackages__"],
deps = [
+ ":geometry_lib",
"//aos/network:team_number",
"//aos/time",
"//third_party:opencv",