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
a4e84573
Commit
a4e84573
authored
Jun 19, 2015
by
Kurnianggoro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing some alignments
parent
244b7926
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
35 deletions
+26
-35
trackerKCF.cpp
modules/tracking/src/trackerKCF.cpp
+26
-35
No files found.
modules/tracking/src/trackerKCF.cpp
View file @
a4e84573
...
...
@@ -563,7 +563,7 @@ namespace cv{
//threshold(xy,xy,0.0,0.0,THRESH_TOZERO);//max(0, (xx + yy - 2 * xy) / numel(x))
for
(
int
i
=
0
;
i
<
xy
.
rows
;
i
++
){
for
(
int
j
=
0
;
j
<
xy
.
cols
;
j
++
){
if
(
xy
.
at
<
double
>
(
i
,
j
)
<
0.0
)
xy
.
at
<
double
>
(
i
,
j
)
=
0.0
;
if
(
xy
.
at
<
double
>
(
i
,
j
)
<
0.0
)
xy
.
at
<
double
>
(
i
,
j
)
=
0.0
;
}
}
...
...
@@ -584,8 +584,8 @@ namespace cv{
int
_k
=
(
mat
.
rows
-
1
);
mat
.
row
(
_k
).
copyTo
(
temp
);
for
(;
_k
>
0
;
_k
--
)
{
m
=
mat
.
row
(
_k
);
mat
.
row
(
_k
-
1
).
copyTo
(
m
);
m
=
mat
.
row
(
_k
);
mat
.
row
(
_k
-
1
).
copyTo
(
m
);
}
m
=
mat
.
row
(
0
);
temp
.
copyTo
(
m
);
...
...
@@ -594,42 +594,33 @@ namespace cv{
// circular shift n rows from up to down if n > 0, -n rows from down to up if n < 0
void
TrackerKCFImpl
::
shiftRows
(
Mat
&
mat
,
int
n
)
const
{
if
(
n
<
0
)
{
n
=
-
n
;
flip
(
mat
,
mat
,
0
);
for
(
int
_k
=
0
;
_k
<
n
;
_k
++
)
{
shiftRows
(
mat
);
}
flip
(
mat
,
mat
,
0
);
}
else
{
for
(
int
_k
=
0
;
_k
<
n
;
_k
++
)
{
shiftRows
(
mat
);
}
n
=
-
n
;
flip
(
mat
,
mat
,
0
);
for
(
int
_k
=
0
;
_k
<
n
;
_k
++
)
{
shiftRows
(
mat
);
}
flip
(
mat
,
mat
,
0
);
}
else
{
for
(
int
_k
=
0
;
_k
<
n
;
_k
++
)
{
shiftRows
(
mat
);
}
}
}
//circular shift n columns from left to right if n > 0, -n columns from right to left if n < 0
void
TrackerKCFImpl
::
shiftCols
(
Mat
&
mat
,
int
n
)
const
{
if
(
n
<
0
){
n
=
-
n
;
flip
(
mat
,
mat
,
1
);
transpose
(
mat
,
mat
);
shiftRows
(
mat
,
n
);
transpose
(
mat
,
mat
);
flip
(
mat
,
mat
,
1
);
}
else
{
transpose
(
mat
,
mat
);
shiftRows
(
mat
,
n
);
transpose
(
mat
,
mat
);
n
=
-
n
;
flip
(
mat
,
mat
,
1
);
transpose
(
mat
,
mat
);
shiftRows
(
mat
,
n
);
transpose
(
mat
,
mat
);
flip
(
mat
,
mat
,
1
);
}
else
{
transpose
(
mat
,
mat
);
shiftRows
(
mat
,
n
);
transpose
(
mat
,
mat
);
}
}
...
...
@@ -659,9 +650,9 @@ namespace cv{
for
(
int
i
=
0
;
i
<
_k
.
rows
;
i
++
){
for
(
int
j
=
0
;
j
<
_k
.
cols
;
j
++
){
temp
=
std
::
complex
<
double
>
(
spec
.
at
<
Vec2d
>
(
i
,
j
)[
0
],
spec
.
at
<
Vec2d
>
(
i
,
j
)[
1
])
/
(
std
::
complex
<
double
>
(
_alphaf_den
.
at
<
Vec2d
>
(
i
,
j
)[
0
],
_alphaf_den
.
at
<
Vec2d
>
(
i
,
j
)[
1
])
/*+std::complex<double>(0.0000000001,0.0000000001)*/
);
spec2
.
at
<
Vec2d
>
(
i
,
j
)[
0
]
=
temp
.
real
();
spec2
.
at
<
Vec2d
>
(
i
,
j
)[
1
]
=
temp
.
imag
();
temp
=
std
::
complex
<
double
>
(
spec
.
at
<
Vec2d
>
(
i
,
j
)[
0
],
spec
.
at
<
Vec2d
>
(
i
,
j
)[
1
])
/
(
std
::
complex
<
double
>
(
_alphaf_den
.
at
<
Vec2d
>
(
i
,
j
)[
0
],
_alphaf_den
.
at
<
Vec2d
>
(
i
,
j
)[
1
])
/*+std::complex<double>(0.0000000001,0.0000000001)*/
);
spec2
.
at
<
Vec2d
>
(
i
,
j
)[
0
]
=
temp
.
real
();
spec2
.
at
<
Vec2d
>
(
i
,
j
)[
1
]
=
temp
.
imag
();
}
}
...
...
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