Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
ad8cf97e
Commit
ad8cf97e
authored
Sep 27, 2018
by
berak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tracking: add a threshold to the CSRT tracker
parent
ff59193d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
tracking.bib
modules/tracking/doc/tracking.bib
+7
-0
tracker.hpp
modules/tracking/include/opencv2/tracking/tracker.hpp
+2
-0
trackerCSRT.cpp
modules/tracking/src/trackerCSRT.cpp
+11
-1
No files found.
modules/tracking/doc/tracking.bib
View file @
ad8cf97e
...
...
@@ -107,3 +107,10 @@ author={Bolme, David S. and Beveridge, J. Ross and Draper, Bruce A. and Lui Yui,
booktitle = {Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2010}
}
@Article{Lukezic_IJCV2018,
author={Luke{\v{z}}i{\v{c}}, Alan and Voj{'i}{\v{r}}, Tom{'a}{\v{s}} and {\v{C}}ehovin Zajc, Luka and Matas, Ji{\v{r}}{'i} and Kristan, Matej},
title={Discriminative Correlation Filter Tracker with Channel and Spatial Reliability},
journal={International Journal of Computer Vision},
year={2018},
}
modules/tracking/include/opencv2/tracking/tracker.hpp
View file @
ad8cf97e
...
...
@@ -1513,6 +1513,8 @@ public:
float
scale_model_max_area
;
float
scale_lr
;
float
scale_step
;
float
psr_threshold
;
//!< we lost the target, if the psr is lower than this.
};
/** @brief Constructor
...
...
modules/tracking/src/trackerCSRT.cpp
View file @
ad8cf97e
...
...
@@ -429,8 +429,12 @@ Point2f TrackerCSRTImpl::estimate_new_position(const Mat &image)
Mat
resp
=
calculate_response
(
image
,
csr_filter
);
double
max_val
;
Point
max_loc
;
minMaxLoc
(
resp
,
NULL
,
NULL
,
NULL
,
&
max_loc
);
minMaxLoc
(
resp
,
NULL
,
&
max_val
,
NULL
,
&
max_loc
);
if
(
max_val
<
params
.
psr_threshold
)
return
Point2f
(
-
1
,
-
1
);
// target "lost"
// take into account also subpixel accuracy
float
col
=
((
float
)
max_loc
.
x
)
+
subpixel_peak
(
resp
,
"horizontal"
,
max_loc
);
float
row
=
((
float
)
max_loc
.
y
)
+
subpixel_peak
(
resp
,
"vertical"
,
max_loc
);
...
...
@@ -472,6 +476,8 @@ bool TrackerCSRTImpl::updateImpl(const Mat& image_, Rect2d& boundingBox)
}
object_center
=
estimate_new_position
(
image
);
if
(
object_center
.
x
<
0
&&
object_center
.
y
<
0
)
return
false
;
current_scale_factor
=
dsst
.
getScale
(
image
,
object_center
);
//update bouding_box according to new scale and location
...
...
@@ -651,6 +657,7 @@ TrackerCSRT::Params::Params()
histogram_bins
=
16
;
background_ratio
=
2
;
histogram_lr
=
0.04
f
;
psr_threshold
=
0.035
f
;
}
void
TrackerCSRT
::
Params
::
read
(
const
FileNode
&
fn
)
...
...
@@ -708,6 +715,8 @@ void TrackerCSRT::Params::read(const FileNode& fn)
fn
[
"background_ratio"
]
>>
background_ratio
;
if
(
!
fn
[
"histogram_lr"
].
empty
())
fn
[
"histogram_lr"
]
>>
histogram_lr
;
if
(
!
fn
[
"psr_threshold"
].
empty
())
fn
[
"psr_threshold"
]
>>
psr_threshold
;
CV_Assert
(
number_of_scales
%
2
==
1
);
CV_Assert
(
use_gray
||
use_color_names
||
use_hog
||
use_rgb
);
}
...
...
@@ -739,5 +748,6 @@ void TrackerCSRT::Params::write(FileStorage& fs) const
fs
<<
"histogram_bins"
<<
histogram_bins
;
fs
<<
"background_ratio"
<<
background_ratio
;
fs
<<
"histogram_lr"
<<
histogram_lr
;
fs
<<
"psr_threshold"
<<
psr_threshold
;
}
}
/* namespace cv */
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