1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-20 12:55:15 +08:00

tracking: rework tracking API

- simplify Tracker API
- fix perf tests (don't measure video decoding)
This commit is contained in:
Alexander Alekhin
2020-10-27 21:18:18 +00:00
parent 2cb3f65131
commit 80c197590c
89 changed files with 3629 additions and 4334 deletions

View File

@@ -93,7 +93,7 @@ struct AlgoWrap
Ptr<Tracker> tracker;
bool lastRes;
Rect2d lastBox;
Rect lastBox;
State lastState;
// visual
@@ -112,14 +112,14 @@ struct AlgoWrap
void eval(const Mat &frame, const Rect2d &gtBox, bool isVerbose)
{
// RUN
lastBox = Rect2d();
lastBox = Rect();
int64 frameTime = getTickCount();
lastRes = tracker->update(frame, lastBox);
frameTime = getTickCount() - frameTime;
// RESULTS
double intersectArea = (gtBox & lastBox).area();
double unionArea = (gtBox | lastBox).area();
double intersectArea = (gtBox & (Rect2d)lastBox).area();
double unionArea = (gtBox | (Rect2d)lastBox).area();
numTotal++;
numResponse += (lastRes && isGoodBox(lastBox)) ? 1 : 0;
numPresent += isGoodBox(gtBox) ? 1 : 0;