diff --git a/links.txt b/links.txt new file mode 100644 index 0000000..4fde36f --- /dev/null +++ b/links.txt @@ -0,0 +1,9 @@ +https://www.mtgsalvation.com/forums/magic-fundamentals/other-magic-products/third-party-products/337224-mtg-gatherer-extractor-v7-0-database-pics + +https://github.com/devonmurphy/GathererImageGatherer + +https://mtgjson.com/ + +https://gatherer.wizards.com/Pages/Default.aspx + +https://www.youtube.com/watch?v=kbYDjBa3Lyk diff --git a/src/flann_maker/config.h.in b/src/flann_maker/config.h.in new file mode 100644 index 0000000..cd898d1 --- /dev/null +++ b/src/flann_maker/config.h.in @@ -0,0 +1,3 @@ +#pragma once + +#define PROGRAM_NAME "@PROGRAM_NAME@" diff --git a/src/flann_maker/main.cpp b/src/flann_maker/main.cpp new file mode 100644 index 0000000..64fb90b --- /dev/null +++ b/src/flann_maker/main.cpp @@ -0,0 +1,38 @@ +#include "config.h" +#include +#include +#include +#include +#include +#include + +namespace mgs { +} //namespace mgs + +int main (int argc, char* argv[]) { + using std::string; + using std::runtime_error; + + if (2 != argc) { + std::cerr << "Wrong argument count " << argc - 1 << '\n'; + return 2; + } + + try { + cv::Mat image = cv::imread(argv[1]); + if (image.empty()) + throw runtime_error(string("Unable to load image \"") + argv[1] + "\""); + + cv::String win_name{PROGRAM_NAME}; + cv::namedWindow(win_name); + cv::imshow(win_name, image); + cv::waitKey(0); + cv::destroyWindow(win_name); + } + catch (const runtime_error& err) { + std::cerr << "Unhandled exception: " << err.what() << '\n'; + return 1; + } + + return 0; +} diff --git a/src/flann_maker/meson.build b/src/flann_maker/meson.build new file mode 100644 index 0000000..089f8a4 --- /dev/null +++ b/src/flann_maker/meson.build @@ -0,0 +1,15 @@ +project_name = fs.name(meson.current_source_dir()) + +libopencv_dep = dependency('opencv4') + +conf = configuration_data() +conf.set('PROGRAM_NAME', project_name) +config_file = configure_file(input: 'config.h.in', output: 'config.h', configuration: conf) + +executable(project_name, + 'main.cpp', + dependencies: [ + libopencv_dep, + ], + install: true, +) diff --git a/src/meson.build b/src/meson.build index dd34e73..caad6e8 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1 +1,2 @@ subdir('recognition') +subdir('flann_maker') diff --git a/src/recognition/meson.build b/src/recognition/meson.build index e2f9329..7e7ee18 100644 --- a/src/recognition/meson.build +++ b/src/recognition/meson.build @@ -20,4 +20,3 @@ executable(project_name, ], install: true, ) -