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
0327b79d
Commit
0327b79d
authored
Dec 02, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1474 from berak:tracking_fix_kcf
parents
6520dbaa
94c09fe8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
trackerKCF.cpp
modules/tracking/src/trackerKCF.cpp
+10
-3
tutorial_introduction_to_tracker.markdown
...cking/tutorials/tutorial_introduction_to_tracker.markdown
+5
-3
No files found.
modules/tracking/src/trackerKCF.cpp
View file @
0327b79d
...
...
@@ -212,7 +212,10 @@ namespace cv{
*/
bool
TrackerKCFImpl
::
initImpl
(
const
Mat
&
image
,
const
Rect2d
&
boundingBox
){
frame
=
0
;
roi
=
boundingBox
;
roi
.
x
=
cvRound
(
boundingBox
.
x
);
roi
.
y
=
cvRound
(
boundingBox
.
y
);
roi
.
width
=
cvRound
(
boundingBox
.
width
);
roi
.
height
=
cvRound
(
boundingBox
.
height
);
//calclulate output sigma
output_sigma
=
std
::
sqrt
(
static_cast
<
float
>
(
roi
.
width
*
roi
.
height
))
*
params
.
output_sigma_factor
;
...
...
@@ -242,8 +245,8 @@ namespace cv{
// create gaussian response
y
=
Mat
::
zeros
((
int
)
roi
.
height
,(
int
)
roi
.
width
,
CV_32F
);
for
(
int
i
=
0
;
i
<
roi
.
height
;
i
++
){
for
(
int
j
=
0
;
j
<
roi
.
width
;
j
++
){
for
(
int
i
=
0
;
i
<
int
(
roi
.
height
)
;
i
++
){
for
(
int
j
=
0
;
j
<
int
(
roi
.
width
)
;
j
++
){
y
.
at
<
float
>
(
i
,
j
)
=
static_cast
<
float
>
((
i
-
roi
.
height
/
2
+
1
)
*
(
i
-
roi
.
height
/
2
+
1
)
+
(
j
-
roi
.
width
/
2
+
1
)
*
(
j
-
roi
.
width
/
2
+
1
));
}
...
...
@@ -255,6 +258,10 @@ namespace cv{
// perform fourier transfor to the gaussian response
fft2
(
y
,
yf
);
if
(
image
.
channels
()
==
1
)
{
// disable CN for grayscale images
params
.
desc_pca
&=
~
(
CN
);
params
.
desc_npca
&=
~
(
CN
);
}
model
=
Ptr
<
TrackerKCFModel
>
(
new
TrackerKCFModel
(
params
));
// record the non-compressed descriptors
...
...
modules/tracking/tutorials/tutorial_introduction_to_tracker.markdown
View file @
0327b79d
...
...
@@ -44,12 +44,14 @@ Explanation
@snippet tracking/samples/tutorial_introduction_to_tracker.cpp create
There are at least
5
types of tracker algorithms that can be used:
There are at least
7
types of tracker algorithms that can be used:
+ MIL
+ BOOSTING
+ MEDIANFLOW
+ TLD
+ KCF
+ GOTURN
+ MOSSE
Each tracker algorithm has their own advantages and disadvantages, please refer the documentation of @ref cv::Tracker for more detailed information.
...
...
@@ -64,8 +66,8 @@ Explanation
@snippet tracking/samples/tutorial_introduction_to_tracker.cpp init
Tracker algorithm should be initialized with the provided image data as well as the
bounding box of the tracked object.
Make sure that the bounding box is
not valid (size more than zero) to avoid the initialization process failed
.
Any tracker algorithm should be initialized with the provided image data, and an initial
bounding box of the tracked object.
Make sure that the bounding box is
valid (size more than zero) to avoid failure of the initialization process
.
-#
**Update**
...
...
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