Files
small-image-descriptors/main.cpp
T
2019-09-23 16:57:54 +02:00

52 lines
1.3 KiB
C++

/*#include <Magick++.h>
#include <iostream>
#include <bitset>
#include <climits>
#include <boost/filesystem/fstream.hpp>
#include <string>*/
#include <exception>
#include "DescriptorManager.h"
#include <boost/filesystem.hpp>
#include <Magick++.h>
using namespace Magick;
enum method {avg_color, num_color, median, sobel, pearson, threshold, dct_pearson, dct_median};
int main(int argc, char **argv) {
std::string imagename = "im3102.jpg";
int method = method::median;
if (argc > 2) {
method = atoi(argv[2]);
imagename = argv[1];
}
else {
std::cout << "Usage: " << std::endl << argv[0] << " [fileName] [methodIndex]" << std::endl;
std::cout << "Continuing.." << std::endl;
}
InitializeMagick(*argv);
DescriptorManager* manager;
try {
manager = new DescriptorManager("data");
} catch (const std::exception& e) {
std::cout << "Creating manager failed: " << e.what() << std::endl;
return -1;
}
manager->Init();/*
manager->rankImages(imagename, method);
manager->outputRank(imagename, method);
manager->outputMap(method);*/
/*cout << endl;
const int thread_count = 8;
thread* thrds[thread_count];
for (int i =0; i < thread_count; i++) {
thrds[i] = new thread(&DescriptorManager::test, manager, i);
}
for (int i =0; i < thread_count; i++) {
thrds[i]->join();
}*/
//manager->test();
return 0;
}