Skip to content

Commit 2be486c

Browse files
committed
Merge branch 'new_tracks'
# Conflicts: # src/Tracker/VOTTracker.hpp # src/Tracker/dat/dat_tracker.cpp # src/Tracker/dat/dat_tracker.hpp # src/Tracker/staple/fhog.cpp # src/Tracker/staple/staple_tracker.cpp # src/Tracker/staple/staple_tracker.hpp # src/Tracker/track.cpp
2 parents 3d7cda0 + 765d300 commit 2be486c

8 files changed

Lines changed: 395 additions & 326 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set(CMAKE_CXX_STANDARD 14)
1414

1515
if (CMAKE_COMPILER_IS_GNUCXX)
1616
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic-errors -std=c++14" CACHE STRING COMPILE_FLAGS FORCE)
17-
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -march=native -mtune=native --fast-math -ffast-math -funroll-loops -Wall -DNDEBUG -DBOOST_DISABLE_ASSERTS" CACHE STRING COMPILE_FLAGS FORCE)
17+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -march=native -mtune=native -funroll-loops -Wall -DNDEBUG -DBOOST_DISABLE_ASSERTS" CACHE STRING COMPILE_FLAGS FORCE)
1818
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -march=native -mtune=native -Wall -DDEBUG" CACHE STRING COMPILE_FLAGS FORCE)
1919
elseif (MSVC)
2020
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox /Ob2 /Oi /Ot /arch:AVX /fp:fast /EHsc /W4 -DGTL_STATIC" CACHE STRING COMPILE_FLAGS FORCE)

src/Tracker/VOTTracker.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ class VOTTracker
1616
}
1717

1818
virtual void Initialize(const cv::Mat &im, cv::Rect region) = 0;
19-
virtual cv::Rect Update(const cv::Mat &im) = 0;
19+
virtual cv::Rect Update(const cv::Mat &im, float& confidence) = 0;
2020
virtual void Train(const cv::Mat &im, bool first) = 0;
2121
};

src/Tracker/dat/dat_tracker.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,13 @@ void DAT_TRACKER::Initialize(const cv::Mat &im, cv::Rect region)
8181
///
8282
/// \brief DAT_TRACKER::tracker_dat_update
8383
/// \param I
84+
/// \param confidence
8485
/// \return
8586
///
86-
cv::Rect DAT_TRACKER::Update(const cv::Mat &im)
87+
cv::Rect DAT_TRACKER::Update(const cv::Mat &im, float& confidence)
8788
{
89+
confidence = 0;
90+
8891
cv::Mat img_preprocessed;
8992
cv::resize(im, img_preprocessed, cv::Size(), scale_factor_, scale_factor_);
9093
cv::Mat img;
@@ -156,7 +159,9 @@ cv::Rect DAT_TRACKER::Update(const cv::Mat &im)
156159
float(hypotheses[i].y) + float(hypotheses[i].height) / 2.));
157160
candidate_scores.push_back(vote_scores[i] * dist_scores[i]);
158161
}
159-
int best_candidate = max_element(candidate_scores.begin(), candidate_scores.end()) - candidate_scores.begin();
162+
auto maxEl = std::max_element(candidate_scores.begin(), candidate_scores.end());
163+
int best_candidate = maxEl - candidate_scores.begin();
164+
confidence = *maxEl;
160165

161166
target_pos = candidate_centers[best_candidate];
162167

src/Tracker/dat/dat_tracker.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class DAT_TRACKER : public VOTTracker
4646
~DAT_TRACKER();
4747

4848
void Initialize(const cv::Mat &im, cv::Rect region);
49-
cv::Rect Update(const cv::Mat &im);
49+
cv::Rect Update(const cv::Mat &im, float& confidence);
5050
void Train(const cv::Mat &im, bool first);
5151

5252
protected:

src/Tracker/staple/fhog.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#include <cstring>
22
#include <iostream>
33

4-
using namespace std;
5-
64
#include "fhog.h"
75
#undef MIN
86

0 commit comments

Comments
 (0)