From aed05f694cbac0dea8da199aaa2cce6769473972 Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Sun, 3 Mar 2019 11:19:39 +0100 Subject: [PATCH] More descriptive function comments --- DescriptorManager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/DescriptorManager.cpp b/DescriptorManager.cpp index 913b3aa..6b004f0 100644 --- a/DescriptorManager.cpp +++ b/DescriptorManager.cpp @@ -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>::iterator it = features[i].begin(); it != features[i].end(); ++it) {