Skip to content

Commit

Permalink
Move local struct outside of function
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Aug 29, 2024
1 parent 5cc61bc commit 1d438a7
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions modules/tracker/me/src/moving-edges/vpMeSite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -373,17 +385,6 @@ std::vector<vpMeSite> &outputHypotheses, const unsigned numCandidates)

vpMeSite *list_query_pixels = getQueryList(I, static_cast<int>(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.
Expand Down

0 comments on commit 1d438a7

Please sign in to comment.