Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
bdfb7b0e
Commit
bdfb7b0e
authored
Apr 07, 2016
by
Fm
Browse files
Added regression test for corellation_tracker
parent
13ea9e58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
dlib/test/corellation_tracker.cpp
dlib/test/corellation_tracker.cpp
+5
-2
No files found.
dlib/test/corellation_tracker.cpp
View file @
bdfb7b0e
// Copyright (C) 201
3
Davis E. King (davis@dlib.net)
// Copyright (C) 201
6
Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
// License: Boost Software License See LICENSE.txt for the full license.
#include "tester.h"
#include "tester.h"
...
@@ -60,18 +60,21 @@ namespace
...
@@ -60,18 +60,21 @@ namespace
{
{
std
::
istringstream
sin
(
frames
[
i
]());
std
::
istringstream
sin
(
frames
[
i
]());
load_bmp
(
img
,
sin
);
load_bmp
(
img
,
sin
);
double
res
=
tracker
.
update
(
img
);
double
res
=
tracker
.
update
(
img
);
double
correct_res
=
correct_update_results
[
i
];
double
correct_res
=
correct_update_results
[
i
];
double
res_diff
=
abs
(
correct_res
-
res
);
double
res_diff
=
abs
(
correct_res
-
res
);
// small error possible due to rounding and different optimization options
drectangle
pos
=
tracker
.
get_position
();
drectangle
pos
=
tracker
.
get_position
();
drectangle
correct_pos
=
correct_rects
[
i
];
drectangle
correct_pos
=
correct_rects
[
i
];
drectangle
pos_intresect
=
pos
.
intersect
(
correct_pos
);
drectangle
pos_intresect
=
pos
.
intersect
(
correct_pos
);
double
pos_area
=
pos
.
area
();
double
pos_area
=
pos
.
area
();
double
intersect_area
=
pos_intresect
.
area
();
double
intersect_area
=
pos_intresect
.
area
();
double
rect_confidence
=
intersect_area
/
pos_area
;
double
rect_confidence
=
intersect_area
/
pos_area
;
dlog
<<
LINFO
<<
"Frame #"
<<
i
<<
" res: "
<<
res
<<
" correct res: "
<<
correct_res
<<
" pos: "
<<
pos
dlog
<<
LINFO
<<
"Frame #"
<<
i
<<
" res: "
<<
res
<<
" correct res: "
<<
correct_res
<<
" pos: "
<<
pos
<<
" correct pos: "
<<
correct_pos
<<
" rect confidence: "
<<
rect_confidence
;
<<
" correct pos: "
<<
correct_pos
<<
" rect confidence: "
<<
rect_confidence
;
// small error possible due to rounding and different optimization options
// small error possible due to rounding and different optimization options
DLIB_TEST
(
res_diff
<=
1
);
DLIB_TEST
(
res_diff
<=
1
);
DLIB_TEST
(
rect_confidence
>=
0.99
);
DLIB_TEST
(
rect_confidence
>=
0.99
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment