Compute the image undistort map only once
Reusing the map is almost 10 times faster than recomputing it each
iteration.
Also cleaned up some reused code between camera reader and viewer.
Signed-off-by: Milind Upadhyay <milind.upadhyay@gmail.com>
Change-Id: I2c1e6b6b5533054e356eca077778f01f9e8456a1
diff --git a/y2022/vision/viewer_replay.cc b/y2022/vision/viewer_replay.cc
index b2d3464..5d09d55 100644
--- a/y2022/vision/viewer_replay.cc
+++ b/y2022/vision/viewer_replay.cc
@@ -194,6 +194,8 @@
bool use_image = true;
if (FLAGS_detected_only || FLAGS_filtered_only) {
+ // TODO(milind): if adding target estimation here in the future,
+ // undistortion is needed
BlobDetector::BlobResult blob_result;
BlobDetector::ExtractBlobs(image_mat, &blob_result);