More descriptive function comments
This commit is contained in:
@@ -32,6 +32,7 @@ DescriptorManager::DescriptorManager(const fs::path & image_path) {
|
||||
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,
|
||||
@@ -139,7 +140,8 @@ void DescriptorManager::Init() {
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
//Sorts all images we have on distance from the query image
|
||||
//Sorts all base (unmutated) images in order of distance from the given image
|
||||
//After this function the distances array will be filled
|
||||
void DescriptorManager::rankImages(string image_name, int method) {
|
||||
bitset<64> target;
|
||||
if (features[method].count(image_name) && initialized) { //if we have image
|
||||
@@ -156,7 +158,8 @@ void DescriptorManager::rankImages(string image_name, int method) {
|
||||
}
|
||||
}
|
||||
|
||||
//inserts the descriptors of the mutated versions of the image.
|
||||
//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
|
||||
void DescriptorManager::rankMutations(string image_name, int method) {
|
||||
bitset<64> target;
|
||||
@@ -190,6 +193,8 @@ void DescriptorManager::rankMutations(string image_name, int method) {
|
||||
}
|
||||
}
|
||||
|
||||
//Needs to be called after Init().
|
||||
//Takes all the calculated features and rankes
|
||||
void DescriptorManager::runExperiments() {
|
||||
for (int i = 0; i < numDescriptors; i++) {
|
||||
for (map<string, bitset<64>>::iterator it = features[i].begin(); it != features[i].end(); ++it) {
|
||||
|
||||
Reference in New Issue
Block a user