diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-08-29 21:30:53 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-08-29 21:30:53 -0400 |
commit | 8cbd8ff531bf2c1c98ee8141981c95d6950a8175 (patch) | |
tree | 7dd08a02abdb3fe23087ea149e7685d7ffa11f01 /tests | |
parent | a0c4f6e2daafa8998bdb4efa3fc50f7d9b3bdb1c (diff) | |
download | deduper-8cbd8ff531bf2c1c98ee8141981c95d6950a8175.tar.xz |
Make signature test non-stupid.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/signature_test.cpp | 12 |
1 files 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 <vector> #include "signature.hpp" //#include <opencv2/highgui.hpp> -int main() +int main(int argc, char **argv) { std::vector<signature> 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; |