aboutsummaryrefslogtreecommitdiff
path: root/tests/signature_test.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-08-27 00:55:38 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-08-27 00:55:38 -0400
commit96fc17b99d56eb636c894c5be9ab39bfdb4ba454 (patch)
treef558b185b55eddc83e9eb77a695b93290000a96e /tests/signature_test.cpp
downloaddeduper-96fc17b99d56eb636c894c5be9ab39bfdb4ba454.tar.xz
Initial code dump.
Diffstat (limited to 'tests/signature_test.cpp')
-rw-r--r--tests/signature_test.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/signature_test.cpp b/tests/signature_test.cpp
new file mode 100644
index 0000000..0b6b1f9
--- /dev/null
+++ b/tests/signature_test.cpp
@@ -0,0 +1,20 @@
+#include <cstdio>
+#include <vector>
+#include "signature.hpp"
+//#include <opencv2/highgui.hpp>
+int main()
+{
+ std::vector<signature> a;
+ a.push_back(std::move(signature::from_file("img/x.jpg")));
+ a.push_back(std::move(signature::from_file("img/z.jpg")));
+ for (size_t i = 0; i < a.size(); ++i)
+ for (size_t j = 0; 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);
+ }
+ //while (cv::waitKey(0) != 'q');
+ return 0;
+}