diff --git a/Descriptor.h b/Descriptor.h index be9419c..77da5d1 100644 --- a/Descriptor.h +++ b/Descriptor.h @@ -20,7 +20,7 @@ public: //Interpret the bitsets as integers and calculate their distance. virtual uint64_t distance(uint64_t a, uint64_t b) { - return abs((long long)a - (long long)b); + return abs((int64_t)(a - b)); }; virtual string ToString() = 0; virtual fs::path ToPath() { @@ -37,8 +37,6 @@ public: virtual void preview(Image* img) { cout << "No preview defined. :-( " << endl; } - - //Helper functions }; //Average color of the image. @@ -52,7 +50,7 @@ public: ssize_t m = img->rows(); Pixels view(*img); const Quantum *p = view.getConst(0, 0, n, m); //entire image - unsigned long long red = 0, green = 0, blue = 0; + uint64_t red = 0, green = 0, blue = 0; float numpixels = (float)(n*m); if (img->channels() < 3) return 0; for (ssize_t j = 0; j < m; j++) { @@ -152,19 +150,14 @@ public: return retval; } - //biterror - unsigned long long distance(uint64_t a, uint64_t b) { - int biterror = 0; - for (int i = 0; i < 64; i++) { - if (a[i] != b[i]) biterror++; - } - return biterror; + uint64_t distance(uint64_t a, uint64_t b) { + return (uint64_t)__builtin_popcountll(a^b); } string ToString() { return "median"; } }; -/* + //Sobel descriptor //Calculates average intensity of the image with //sobel convolution applied in both directions @@ -185,7 +178,7 @@ public: Pixels view(*local_image); const Quantum *p = view.getConst(0, 0, m, n); //entire image - unsigned long long intensity = 0; + uint64_t intensity = 0; int chan = (int)local_image->channels(); for (ssize_t j = 0; j < m; j++) { for (ssize_t i = 0; i < n; i++) { @@ -196,9 +189,9 @@ public: } //cout << endl; } - int scaledIntensity = ((float)(intensity / (n*m)) / QuantumRange) * 255; + uint64_t scaledIntensity = ((float)(intensity / (n*m)) / QuantumRange) * 255; delete local_image; - return uint64_t(scaledIntensity); + return scaledIntensity; } string ToString() { return "sobel"; @@ -223,29 +216,25 @@ public: Pixels view(*local_image); int chan = (int)local_image->channels(); const Quantum *p = view.getConst(0, 0, n, m); //entire image - uint64_t retval(0); + uint64_t retval = 0; int prev = p[0]; //so we always start with a 0 for (ssize_t j = 0; j < m; j++) { for (ssize_t i = 0; i < n; i++) { //LTR scanning //NOTE: Scanning order might be quite relevant for this descriptor int cur = p[0]; - if(prev < cur) retval |= uint64_t(1); //XOR - prev = cur; + if(prev < cur) retval++; + retval <<= 1; p = p + chan; - retval <<= 1; + prev = cur; } } delete local_image; return retval; } - unsigned long long distance(uint64_t a, uint64_t b) { - int biterror = 0; - for (int i = 0; i < 64; i++) { - if (a[i] != b[i]) biterror++; - } - return biterror; + uint64_t distance(uint64_t a, uint64_t b) { + return (uint64_t)__builtin_popcountll(a^b); } string ToString() { return "pearson"; @@ -267,11 +256,10 @@ public: Pixels view(*local_image); int chan = (int)local_image->channels(); const Quantum *p = view.getConst(0, 0, n, m); //entire image - uint64_t retval(0); + uint64_t retval = 0; for (ssize_t j = 0; j < m; j++) { for (ssize_t i = 0; i < n; i++) { - if(p[0] != 0) - retval |= uint64_t(1); //XOR + if(p[0] != 0) retval++; retval <<= 1; p = p + chan; @@ -280,12 +268,8 @@ public: delete local_image; return retval; } - unsigned long long distance(uint64_t a, uint64_t b) { - int biterror = 0; - for (int i = 0; i < 64; i++) { - if (a[i] != b[i]) biterror++; - } - return biterror; + uint64_t distance(uint64_t a, uint64_t b) { + return (uint64_t)__builtin_popcountll(a^b); } string ToString() { return "threshold"; @@ -343,23 +327,17 @@ public: double* converted = CalculateDCT(local_image); double prev = 0; - uint64_t retval(0); + uint64_t retval = 0; for (int i = 0; i < 64; i++) { - if (converted[i] > prev) { - retval |= uint64_t(1); //XOR - } + if (converted[i] > prev) retval++; retval <<= 1; prev = converted[i]; } delete local_image; return retval; } - unsigned long long distance(uint64_t a, uint64_t b) { - int biterror = 0; - for (int i = 0; i < 64; i++) { - if (a[i] != b[i]) biterror++; - } - return biterror; + uint64_t distance(uint64_t a, uint64_t b) { + return (uint64_t)__builtin_popcountll(a^b); } string ToString() { return "DCTPearson"; @@ -393,23 +371,18 @@ public: sort(bullshit, bullshit + 64); float median = (float)(bullshit[31] + bullshit[32]) / 2; - uint64_t retval(0); + uint64_t retval = 0; for (ssize_t i = 0; i < 64; i++) { retval <<= 1; - if (converted[i] > median) - retval |= uint64_t(1); + if (converted[i] > median) retval++; } delete local_image; return retval; } - unsigned long long distance(uint64_t a, uint64_t b) { - int biterror = 0; - for (int i = 0; i < 64; i++) { - if (a[i] != b[i]) biterror++; - } - return biterror; + uint64_t distance(uint64_t a, uint64_t b) { + return (uint64_t)__builtin_popcountll(a^b); } string ToString() { return "DCTMedian"; } -};*/ +}; diff --git a/DescriptorManager.cpp b/DescriptorManager.cpp index b106eab..dd07ed3 100644 --- a/DescriptorManager.cpp +++ b/DescriptorManager.cpp @@ -5,18 +5,25 @@ DescriptorManager::DescriptorManager() { img_path = "data"; //default value } -//Sets image path and defines the image descriptors. DescriptorManager::DescriptorManager(const fs::path & image_path) { img_path = image_path; - + if (!fs::exists(img_path)) { + cout << "Error. Data folder not found." << endl; + return; //No data: giving up. + } + numImages = std::count_if( + fs::directory_iterator(img_path), + fs::directory_iterator(), + static_cast(fs::is_regular_file)); + current_image = NULL; //Manual definitions.. SAD! - /*descriptor_types[7] = new DCTMedian(); + descriptor_types[7] = new DCTMedian(); descriptor_types[6] = new DCTPearson(); descriptor_types[5] = new threshold(); descriptor_types[4] = new pearson(); descriptor_types[3] = new sobel(); descriptor_types[2] = new median(); - descriptor_types[1] = new numColors();*/ + descriptor_types[1] = new numColors(); descriptor_types[0] = new averageColor(); mutators[0] = new Grayscale(); @@ -27,133 +34,128 @@ DescriptorManager::DescriptorManager(const fs::path & image_path) { mutators[5] = new Hue(); mutators[6] = new Brighten(); mutators[7] = new Watermark(); -} -//No need to call destructor.. yet? -DescriptorManager::~DescriptorManager() { - //Do some clean-up? - //Realistically, when this gets destroyed the application is done anyway. - //Let the OS take care of garbage collection -} - -//Loads all base images, calculates their descriptors, -//calculates all image mutations and stores their descriptors -//on disk. -void DescriptorManager::Init() { - //First load all images and store descriptors in cache and disk - if (!fs::exists(img_path)) { - cout << "Error. Data folder not found." << endl; - return; + //Check if all folders are available, create if needed + + if (!fs::is_directory("meta")) + fs::create_directory("meta"); + if (!fs::is_directory("results")) + fs::create_directory("results"); + + for (int i = 0; i < numDescriptors; i++) { + fs::path descriptorBase("meta" / descriptor_types[i]->ToPath()); + fs::path resultFolder("results" / descriptor_types[i]->ToPath()); + if (!fs::is_directory(descriptorBase)) fs::create_directory(descriptorBase); + if (!fs::is_directory(resultFolder)) fs::create_directory(resultFolder); + for (int j = 0; j < numMutations; j++) { + fs::path mutatorDescriptor(descriptorBase / mutators[j]->ToPath()); + if (!fs::is_directory(mutatorDescriptor)) fs::create_directory(mutatorDescriptor); + } } - fs::ifstream ifs; - fs::ofstream ofs; - //LoadFeatures(); + for (int i = 0; i < numMutations; i++) { + fs::path mutationBase(img_path / mutators[i]->ToPath()); + if (!fs::is_directory(mutationBase)) fs::create_directory(mutationBase); + + } +} - numImages = std::count_if( - fs::directory_iterator(img_path), - fs::directory_iterator(), - static_cast(fs::is_regular_file)); - //foreach image in directory (non-recursive) +//Returns a pointer to the image mutated by the given method. +//Either gets it from disk, or calculates it directly. +Image* DescriptorManager::GetMutated(Image* image, string image_name, int method) { + fs::path mutPath(img_path / mutators[method]->ToPath() / image_name); + Image* mutated; + if (!fs::exists(mutPath)) { //only mutate if nothing on disk + mutated = mutators[method]->getMutated(image); + mutated->write(mutPath.generic_string()); + } + else { + mutated = new Image; + mutated->read(mutPath.generic_string()); + } + return mutated; +} + +//Takes the unmodified image and loads its features into memory. +//Either by reading them from disk, or calculating them directly. +//For each of the defined descriptors. +void DescriptorManager::LoadFeatures(string image_path, string image_name) { + for (int i = 0; i < numDescriptors; i++) { + //First check if we already have this information from the loaded cache + if (features[i].count(image_name) > 0) { + continue; + } + current_image = new Image(image_path); + fs::path featurePath("meta" / descriptor_types[i]->ToPath() / image_name); + + uint64_t b1; + if (fs::exists(featurePath)) { //feature on disk, load it in + fs::ifstream ifs(featurePath, fs::fstream::binary); + ifs.read(reinterpret_cast(&b1), sizeof(b1)); + ifs.close(); + } + else { //not on disk, calculate it + b1 = descriptor_types[i]->feature(current_image); + fs::ofstream ofs(featurePath, fs::fstream::binary); + ofs.write(reinterpret_cast(&b1), sizeof(b1)); + ofs.close(); + } + + features[i][image_name] = b1; + } +} + +void DescriptorManager::LoadMutationFeatures(string image_path, string image_name, int mutation) { + for (int i = 0; i < numDescriptors; i++) { + //First check if we already have this information from the loaded cache + if (mutatedFeatures[i][mutation].count(image_name) > 0) { + continue; + } + if (!current_image) current_image->read(image_path); + Image* image = GetMutated(current_image, image_name, i); + fs::path featurePath("meta" / descriptor_types[i]->ToPath() / mutators[mutation]->ToPath() / image_name); + + uint64_t b1; + if (fs::exists(featurePath)) { //feature on disk, load it in + fs::ifstream ifs(featurePath, fs::fstream::binary); + ifs.read(reinterpret_cast(&b1), sizeof(b1)); + ifs.close(); + } + else { //not on disk, calculate it + b1 = descriptor_types[i]->feature(image); + fs::ofstream ofs(featurePath, fs::fstream::binary); + ofs.write(reinterpret_cast(&b1), sizeof(b1)); + ofs.close(); + } + mutatedFeatures[i][mutation][image_name] = b1; + delete image; + } +} + +//Calculates all features, mutations and features of mutations. +//This is generally the first step required +void DescriptorManager::Init() { + LoadFromDisk(); int filecount = 0; for (fs::directory_iterator itr(img_path); itr != fs::directory_iterator(); ++itr) { if (!itr->path().has_extension()) continue; //skip directories and such - filecount++; string image_name = itr->path().filename().generic_string(); - cout << setw(60) << setfill('*') << "\r" << string(60, ' ') << flush; - cout << setfill('*') << setw(60) << right<< "\rProgress: " << filecount*100/numImages << "% - (" << filecount << "/" << numImages << "): " << image_name << flush; - Image* image = new Image; - image->read(itr->path().string()); - //foreach descriptor - for (int i = 0; i < numDescriptors; i++) { - //First check if we already have this information from the loaded cache - if (features[i].count(image_name) > 0) { - //cout << "We already have feature for " << image_name << endl; - continue; - } - //folder to store descriptors; create if not exists - fs::path descriptorBase("meta" / descriptor_types[i]->ToPath()); - if (!fs::is_directory(descriptorBase)) - fs::create_directory(descriptorBase); - //cout << "Starting with descriptor " << i << " on location " << descriptorBase.generic_string() << endl; - - fs::path featurePath(descriptorBase / itr->path().stem()); - uint64_t b1; - if (fs::exists(featurePath)) { //feature on disk, load it in - ifs.open(featurePath, fs::fstream::binary); - ifs.read(reinterpret_cast(&b1), sizeof(b1)); - ifs.close(); - } - else { //not on disk, calculate it - b1 = descriptor_types[i]->feature(image); - ofs.open(featurePath, fs::fstream::binary); - ofs.write(reinterpret_cast(&b1), sizeof(b1)); - ofs.close(); - } - features[i][image_name] = b1; - //SaveFeatures(); + //Image* image = new Image; + string image_path = itr->path().string(); + { //Progress bar + filecount++; + cout << setw(60) << setfill('*') << "\r" << string(60, ' ') << flush; + cout << setfill('*') << setw(60) << right<< "\rProgress: " << filecount*100/numImages << "% - (" << filecount << "/" << numImages << "): " << image_name << flush; } + //Store all base features in the features array + LoadFeatures(image_path, image_name); + //now calculate all the features for the mutated images as well for (int i = 0; i < numMutations; i++) { - //Check if we have somewhere to store the mutation - fs::path mutationBase(img_path / mutators[i]->ToPath()); - if (!fs::is_directory(mutationBase)) - fs::create_directory(mutationBase); - bool missing = false; - for (int j = 0; j < numDescriptors; j++) { - if (mutatedFeatures[j][i].count(image_name) <= 0) { - missing = true; - } - } - fs::path mutPath(mutationBase / itr->path().filename().generic_string()); - Image* mutated; - if (!fs::exists(mutPath)) { //only mutate if nothing on disk - //Measured: about 10ms - auto start = high_resolution_clock::now(); - mutated = mutators[i]->getMutated(image); - mutated->write(mutPath.generic_string()); - auto duration = duration_cast(high_resolution_clock::now() - start); - //cout << "Calculating mutation " << mutators[i]->ToString() << " took " << duration.count() << "μs." << endl; - - } - else { - //Measured: about 4ms - auto start = high_resolution_clock::now(); - mutated = new Image; - mutated->read(mutPath.generic_string()); - auto duration = duration_cast(high_resolution_clock::now() - start); - //cout << "Loading mutation " << mutators[i]->ToString() << " took " << duration.count() << "μs." << endl; - } - - //now calculate all the features for the mutated images as well - //foreach descriptor - for (int j = 0; j < numDescriptors; j++) { - //folder to store descriptors; create if not exists - fs::path descriptorBase("meta" / descriptor_types[j]->ToPath() / mutators[i]->ToPath()); - if (!fs::is_directory(descriptorBase)) - if (fs::create_directory(descriptorBase)) {} - fs::path featurePath(descriptorBase / itr->path().stem()); - //cout << featurePath << endl; - string image_name = itr->path().filename().generic_string(); - uint64_t b1; - if (!fs::exists(featurePath)) { //feature not yet calculated - //descriptor_types[i]->distance(b1, b1); - //descriptors[i][image_name] = b1; - b1 = descriptor_types[j]->feature(mutated); - //cout << "Writing " << *b1 << "(" << n << ")" << " to " << featurePath << endl; - ofs.open(featurePath, fs::fstream::binary); //in binary mode; only open file after calculations have been done - ofs.write(reinterpret_cast(&b1), sizeof(b1)); - ofs.close(); - } - else { - ifs.open(featurePath, fs::fstream::binary); - ifs.read(reinterpret_cast(&b1), sizeof(b1)); - ifs.close(); - } - - mutatedFeatures[j][i][image_name] = b1; - } - delete mutated; + LoadMutationFeatures(image_path, image_name, i); } - delete image; + if (current_image) delete current_image; + current_image = NULL; + //delete image; + SaveToDisk(); } initialized = true; } @@ -161,7 +163,7 @@ void DescriptorManager::Init() { //Saves feature map to disk. //Makes it so that it can reload easily -void DescriptorManager::SaveFeatures() { +void DescriptorManager::SaveToDisk() { { //Boost serialization ofstream f("features.map", ios::binary); //ofstream feature_cache_backup("features.map.bak", ios::binary); @@ -183,7 +185,7 @@ void DescriptorManager::SaveFeatures() { } //Loads saved feature maps from disk. -void DescriptorManager::LoadFeatures() { +void DescriptorManager::LoadFromDisk() { { //Boost ifstream f("features.map", ios::binary); if (f.is_open()) { @@ -213,8 +215,8 @@ void DescriptorManager::rankImages(string image_name, int method) { } distances.clear(); //start fresh for (map::iterator it = features[method].begin(); it != features[method].end(); ++it) { - unsigned long long d = descriptor_types[method]->distance(target, it->second); - pair p(d, it->first); + uint64_t d = descriptor_types[method]->distance(target, it->second); + pair p(d, it->first); distances.insert(p); //pairs are compared by their first element.. } } @@ -222,18 +224,18 @@ void DescriptorManager::rankImages(string image_name, int method) { //Adds mutated descriptors of a given image to a copy of the distances array. //It inserts these mutated descriptors in a sorted way //Assumes the distances array is filled with the normal distances -multiset> DescriptorManager::rankMutations(string image_name, int method) { +multiset> DescriptorManager::rankMutations(string image_name, int method) { uint64_t target; if (features[method].count(image_name) && initialized) { //this should always be the case target = features[method][image_name]; } //cout << "Finding hits for " << image_name << " which has feature-number " << target.to_ullong() << endl; - multiset> local_distance = distances; //get our local copy of the distances. + multiset> local_distance = distances; //get our local copy of the distances. for (int i = 0; i < numMutations; i++) { uint64_t b1 = mutatedFeatures[method][i][image_name]; - unsigned long long d = descriptor_types[method]->distance(target, b1); - pair p(d, mutators[i]->ToString()); + uint64_t d = descriptor_types[method]->distance(target, b1); + pair p(d, mutators[i]->ToString()); local_distance.insert(p); //upper_bound } @@ -242,7 +244,7 @@ multiset> DescriptorManager::rankMutations(stri //cout << "..." << endl; for (int i = 0; i < numMutations; i++) { int j = 0; - for (std::multiset>::iterator it = local_distance.begin(); it != local_distance.end(); ++it) { + for (std::multiset>::iterator it = local_distance.begin(); it != local_distance.end(); ++it) { //cout << "hey " << endl; if (it->second == mutators[i]->ToString()) { cout << j << "th position: "; @@ -261,18 +263,16 @@ void DescriptorManager::runExperiments() { for (map::iterator it = features[i].begin(); it != features[i].end(); ++it) { //cout << "=== " << descriptor_types[i]->ToString() << ": " << it->first << " ===" << endl; rankImages(it->first, i); - multiset> local_distance = rankMutations(it->first, i); + multiset> local_distance = rankMutations(it->first, i); //Now we can draw some conclusions from the received data: //Put all results in some useful files in the results directory: fs::path resultFolder("results" / descriptor_types[i]->ToPath()); - if (!fs::is_directory(resultFolder)) //TODO: Create all folders in Init() - fs::create_directory(resultFolder); for (int i = 0; i < numMutations; i++) { int j = 0; fs::path resultPath(resultFolder / mutators[i]->ToPath()); ofs.open(resultPath, ofstream::out | ofstream::app); - for (std::multiset>::iterator it = local_distance.begin(); it != local_distance.end(); ++it) { + for (std::multiset>::iterator it = local_distance.begin(); it != local_distance.end(); ++it) { if (it->second == mutators[i]->ToString()) { double percentile = (j + 1) / (double)(numImages+numMutations); @@ -289,8 +289,7 @@ void DescriptorManager::runExperiments() { } //outputs the gathered data to iostream -//can be called directly or is called by its overload -//assumes a < numDescriptors +//Tries to do some nice formatting and grouping of bits. void DescriptorManager::outputMap(int a) { cout << "Outputting map " << descriptor_types[a]->ToString() << endl; map a_map = features[a]; @@ -299,7 +298,17 @@ void DescriptorManager::outputMap(int a) { } for (map::iterator it = a_map.begin(); it != a_map.end(); ++it) { - cout << it->first << " => " << it->second << " (" << bitset<64>(it->second) << ")" << endl; + string bits = bitset<64>(it->second).to_string(); + int groupsize = 8; + + cout << setfill(' ') << setw(14) << it->first << " => " << setw(20) << it->second << " ("; + + for (int i=0; i < bits.length(); ++i) { + cout << bits[i]; + if(i % groupsize == groupsize-1 && bits.length()-i > groupsize) cout << " "; + } + + cout << ")" << endl; } } @@ -312,7 +321,8 @@ void DescriptorManager::outputMap() { //Outputs all generated features ordered on distance from the query image. void DescriptorManager::outputRank(string imagename, int method) { - for (std::multiset>::iterator it = distances.begin(); it != distances.end(); ++it) { + cout << "Outputting rank.." << endl; + for (std::multiset>::iterator it = distances.begin(); it != distances.end(); ++it) { cout << "(" << it->first << ", " << it->second << ")" << endl; } } diff --git a/DescriptorManager.h b/DescriptorManager.h index 020061c..c89a859 100644 --- a/DescriptorManager.h +++ b/DescriptorManager.h @@ -42,28 +42,30 @@ class DescriptorManager { public: DescriptorManager(); DescriptorManager(const fs::path & image_path); - ~DescriptorManager(); + void LoadFeatures(string image_path, string image_name); + void LoadMutationFeatures(string image_path, string image_name, int mutation); + Image* GetMutated(Image* image, string image_name, int method); void Init(); - void SaveFeatures(); - void LoadFeatures(); + void SaveToDisk(); + void LoadFromDisk(); void rankImages(string image_name, int method); - multiset> rankMutations(string image_name, int method); + multiset> rankMutations(string image_name, int method); void runExperiments(); void generatePreviews(string imagename); void outputMap(int a); void outputMap(); void outputRank(string imagename, int method); private: - static const int numDescriptors = 1; + static const int numDescriptors = 8; static const int numMutations = 8; //TODO: automagically update this? bool initialized = false; int numImages; - + Image* current_image = NULL; //for caching purposes map features[numDescriptors]; //array of maps that will hold the descriptors map mutatedFeatures[numDescriptors][numMutations]; - multiset > distances; //multiset that stores the distances + multiset > distances; //multiset that stores the distances fs::path img_path; //where the images are Descriptor* descriptor_types[numDescriptors]; Mutation* mutators[numMutations]; diff --git a/SmallImageDescriptors.vcxproj b/SmallImageDescriptors.vcxproj deleted file mode 100644 index e184f40..0000000 --- a/SmallImageDescriptors.vcxproj +++ /dev/null @@ -1,173 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {757D5AAF-32EE-484D-AD0D-B80A212A8870} - Win32Proj - SmallImageDescriptors - 8.1 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v140 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - $(SolutionDir)\include;$(IncludePath) - $(SolutionDir)\lib;$(LibraryPath) - - - false - - - false - $(SolutionDir)\include;C:\Program Files\boost;$(IncludePath) - $(SolutionDir)\lib;C:\Program Files\boost\libs;C:\Program Files\boost\stage\lib64;$(LibraryPath) - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - - - Level3 - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - CORE_RL_Magick++_.lib;%(AdditionalDependencies) - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - CORE_RL_Magick++_.lib;%(AdditionalDependencies) - - - copy "$(TargetPath)" "$(SolutionDir)" - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/main.cpp b/main.cpp index ebd85ed..2322c43 100644 --- a/main.cpp +++ b/main.cpp @@ -23,8 +23,8 @@ using namespace Magick; int main(int argc, char **argv) { - string imagename = "spook.jpg"; - int method = 6; + string imagename = "im3102.jpg"; + int method = 0; int count = 1000; if (argc > 2) { method = atoi(argv[2]); @@ -43,8 +43,9 @@ int main(int argc, char **argv) { //smanager->generatePreviews(imagename); //cout << "Intializing..." << endl; manager->Init(); - cout << endl; - manager->outputMap(); + //cout << endl; + //manager->outputMap(); + //manager->outputRank(imagename, method); //cout << "done!" << endl; // manager->runExperiments();