From ae8c85e984d8fde05780d1e2a4c46cf9b599f78a Mon Sep 17 00:00:00 2001 From: kallaballa Date: Mon, 28 Nov 2022 20:58:58 +0100 Subject: [PATCH] refactoring, renaming and commenting --- src/pedestrian/pedestrian-demo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pedestrian/pedestrian-demo.cpp b/src/pedestrian/pedestrian-demo.cpp index 61b28401d..240c633db 100644 --- a/src/pedestrian/pedestrian-demo.cpp +++ b/src/pedestrian/pedestrian-demo.cpp @@ -18,7 +18,7 @@ constexpr const char* OUTPUT_FILENAME = "pedestrian-demo.mkv"; // On every frame the foreground loses on brightness. specifies the loss in percent. constexpr float FG_LOSS = 3; -// Intensity of glow defined by kernel size. The default scales with the image diagonal. +// Intensity of blur defined by kernel size. The default scales with the image diagonal. constexpr int BLUR_KERNEL_SIZE = std::max(int(DIAG / 200 % 2 == 0 ? DIAG / 200 + 1 : DIAG / 200), 1); using std::cerr; @@ -27,7 +27,7 @@ using std::vector; using std::string; //adapted from cv::dnn_objdetect::InferBbox -static inline bool comparator (std::pair l1, +static inline bool pair_comparator (std::pair l1, std::pair l2) { return l1.first > l2.first; @@ -70,7 +70,7 @@ std::vector non_maximal_suppression(std::vector > *box for (size_t tidx = 0; tidx < (*probs).size(); ++tidx) { temp_sort[tidx] = std::make_pair((*probs)[tidx], static_cast(tidx)); } - std::sort(temp_sort.begin(), temp_sort.end(), comparator); + std::sort(temp_sort.begin(), temp_sort.end(), pair_comparator); for (size_t idx = 0; idx < temp_sort.size(); ++idx) { prob_args_sorted[idx] = temp_sort[idx].second;