From 1d438a78e79b66e32b0e16447e449dc8aebf8624 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 29 Aug 2024 14:58:06 +0200 Subject: [PATCH] Move local struct outside of function --- .../tracker/me/src/moving-edges/vpMeSite.cpp | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/tracker/me/src/moving-edges/vpMeSite.cpp b/modules/tracker/me/src/moving-edges/vpMeSite.cpp index b0ddf15af9..ac779cb8b4 100644 --- a/modules/tracker/me/src/moving-edges/vpMeSite.cpp +++ b/modules/tracker/me/src/moving-edges/vpMeSite.cpp @@ -48,6 +48,18 @@ BEGIN_VISP_NAMESPACE #ifndef DOXYGEN_SHOULD_SKIP_THIS + +struct vpMeSiteHypothesis +{ + vpMeSiteHypothesis(vpMeSite *site, double l, double c) : site(site), likelihood(l), contrast(c) + { } + + vpMeSite *site; + double likelihood; + double contrast; + +}; + static bool horsImage(int i, int j, int half, int rows, int cols) { int half_1 = half + 1; @@ -373,17 +385,6 @@ std::vector &outputHypotheses, const unsigned numCandidates) vpMeSite *list_query_pixels = getQueryList(I, static_cast(range)); - struct vpMeSiteHypothesis - { - vpMeSiteHypothesis(vpMeSite *site, double l, double c) : site(site), likelihood(l), contrast(c) - { } - - vpMeSite *site; - double likelihood; - double contrast; - - }; - // Insert into a map, where the key is the sorting criterion (negative likelihood or contrast diff) // and the key is the ME site + its computed likelihood and contrast. // After computation: iterating on the map is guaranteed to be done with the keys being sorted according to the criterion.