aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/signature_test.cpp41
1 files changed, 37 insertions, 4 deletions
diff --git a/tests/signature_test.cpp b/tests/signature_test.cpp
index 32a763c..df22b0f 100644
--- a/tests/signature_test.cpp
+++ b/tests/signature_test.cpp
@@ -1,18 +1,51 @@
#include <cstdio>
#include <vector>
+#include "subslice_signature.hpp"
#include "signature.hpp"
-//#include <opencv2/highgui.hpp>
+
+signature_config cfg_full =
+{
+ 9, //slices
+ 3, //blur_window
+ 2, //min_window
+ true, //crop
+ true, //comp
+ 0.5, //pr
+ 1./128, //noise_threshold
+ 0.05, //contrast_threshold
+ 0.25 //max_cropping
+};
+
+signature_config cfg_subslice =
+{
+ 4, //slices
+ 16, //blur_window
+ 2, //min_window
+ false, //crop
+ true, //comp
+ 0.5, //pr
+ 1./64, //noise_threshold
+ 0.05, //contrast_threshold
+ 0.25 //max_cropping
+};
+
int main(int argc, char **argv)
{
- std::vector<signature> a;
+ std::vector<subsliced_signature> a;
for (int i = 1; i < argc; ++i)
- a.push_back(std::move(signature::from_file(argv[i], signature::default_cfg())));
+ a.push_back(std::move(subsliced_signature::from_file(argv[i], 3, 3, cfg_full, cfg_subslice)));
+ for (auto& ss : a)
+ {
+ for (auto& s : ss.subslices)
+ printf("%lu ", signature_hash{}(s));
+ puts("");
+ }
if (a.size() < 2) return 0;
for (size_t i = 0; i < a.size(); ++i)
for (size_t j = i + 1; j < a.size(); ++j)
{
printf("%lu <-> %lu:", i, j);
- double d = a[i].distance(a[j]);
+ double d = a[i].full.distance(a[j].full);
printf("%f\n", d);
}
//while (cv::waitKey(0) != 'q');