a75f9be4e7
Als alternatief voor md5
32 lines
745 B
C++
Executable File
32 lines
745 B
C++
Executable File
#include <iostream>
|
|
#include <Magick++.h>
|
|
#include <bitset>
|
|
#include <string>
|
|
#include <codecvt>
|
|
#include <locale>
|
|
#include <iomanip>
|
|
#include "Descriptor.h"
|
|
|
|
using namespace Magick;
|
|
|
|
int main(int argc, char **argv) {
|
|
std::string filename;
|
|
if (argc > 1) {
|
|
filename = argv[1];
|
|
}
|
|
else {
|
|
std::cout << "Usage: " << std::endl << argv[0] << " filename" << std::endl;
|
|
std::cout << "Continuing.." << std::endl;
|
|
}
|
|
Descriptor* d = new DCTMedian();
|
|
InitializeMagick(*argv);
|
|
Image* img = new Image(filename);
|
|
uint64_t result = d->feature(img);
|
|
std::cout << std::hex << result;
|
|
if (argc > 2) {
|
|
std::cout << std::endl << std::dec << result;
|
|
std::cout << std::endl << bitset<64>(result).to_string() << std::endl;
|
|
}
|
|
return 0;
|
|
}
|