From 8cbd8ff531bf2c1c98ee8141981c95d6950a8175 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 29 Aug 2022 21:30:53 -0400 Subject: Make signature test non-stupid. --- tests/signature_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/signature_test.cpp b/tests/signature_test.cpp index 8d44431..32a763c 100644 --- a/tests/signature_test.cpp +++ b/tests/signature_test.cpp @@ -2,18 +2,18 @@ #include #include "signature.hpp" //#include -int main() +int main(int argc, char **argv) { std::vector a; - a.push_back(std::move(signature::from_file("img/x.jpg", signature::default_cfg()))); - a.push_back(std::move(signature::from_file("img/z.jpg", signature::default_cfg()))); + for (int i = 1; i < argc; ++i) + a.push_back(std::move(signature::from_file(argv[i], signature::default_cfg()))); + if (a.size() < 2) return 0; for (size_t i = 0; i < a.size(); ++i) - for (size_t j = 0; j < a.size(); ++j) + for (size_t j = i + 1; j < a.size(); ++j) { printf("%lu <-> %lu:", i, j); double d = a[i].distance(a[j]); - double l = a[i].length() + a[j].length(); - printf("%f\n", d / l); + printf("%f\n", d); } //while (cv::waitKey(0) != 'q'); return 0; -- cgit v1.2.3