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
d1efcd94
Commit
d1efcd94
authored
Apr 07, 2016
by
Fm
Browse files
Added options for corellation tracker
parent
71af6f48
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
dlib/image_processing/correlation_tracker.h
dlib/image_processing/correlation_tracker.h
+13
-13
No files found.
dlib/image_processing/correlation_tracker.h
View file @
d1efcd94
...
@@ -138,36 +138,36 @@ namespace dlib
...
@@ -138,36 +138,36 @@ namespace dlib
// use the current filter to predict the object's location
// use the current filter to predict the object's location
G
=
0
;
G
=
0
;
for
(
unsigned
long
i
=
0
;
i
<
F
.
size
();
++
i
)
for
(
unsigned
long
i
=
0
;
i
<
F
.
size
();
++
i
)
G
+=
pointwise_multiply
(
F
[
i
],
conj
(
A
[
i
]));
G
+=
pointwise_multiply
(
F
[
i
],
conj
(
A
[
i
]));
G
=
pointwise_multiply
(
G
,
reciprocal
(
B
+
get_regularizer_space
()));
G
=
pointwise_multiply
(
G
,
reciprocal
(
B
+
get_regularizer_space
()));
ifft_inplace
(
G
);
ifft_inplace
(
G
);
const
dlib
::
vector
<
double
,
2
>
pp
=
max_point_interpolated
(
real
(
G
));
const
dlib
::
vector
<
double
,
2
>
pp
=
max_point_interpolated
(
real
(
G
));
// Compute the peak to side lobe ratio.
// Compute the peak to side lobe ratio.
const
point
p
=
pp
;
const
point
p
=
pp
;
running_stats
<
double
>
rs
;
running_stats
<
double
>
rs
;
const
rectangle
peak
=
centered_rect
(
p
,
8
,
8
);
const
rectangle
peak
=
centered_rect
(
p
,
8
,
8
);
for
(
long
r
=
0
;
r
<
G
.
nr
();
++
r
)
for
(
long
r
=
0
;
r
<
G
.
nr
();
++
r
)
{
{
for
(
long
c
=
0
;
c
<
G
.
nc
();
++
c
)
for
(
long
c
=
0
;
c
<
G
.
nc
();
++
c
)
{
{
if
(
!
peak
.
contains
(
point
(
c
,
r
)))
if
(
!
peak
.
contains
(
point
(
c
,
r
)))
rs
.
add
(
G
(
r
,
c
).
real
());
rs
.
add
(
G
(
r
,
c
).
real
());
}
}
}
}
const
double
psr
=
(
G
(
p
.
y
(),
p
.
x
()).
real
()
-
rs
.
mean
())
/
rs
.
stddev
();
const
double
psr
=
(
G
(
p
.
y
(),
p
.
x
()).
real
()
-
rs
.
mean
())
/
rs
.
stddev
();
// update the position of the object
// update the position of the object
position
=
translate_rect
(
guess
,
tform
(
pp
)
-
center
(
guess
));
position
=
translate_rect
(
guess
,
tform
(
pp
)
-
center
(
guess
));
// now update the position filters
// now update the position filters
make_target_location_image
(
pp
,
G
);
make_target_location_image
(
pp
,
G
);
B
*=
(
1
-
get_nu_space
());
B
*=
(
1
-
get_nu_space
());
for
(
unsigned
long
i
=
0
;
i
<
F
.
size
();
++
i
)
for
(
unsigned
long
i
=
0
;
i
<
F
.
size
();
++
i
)
{
{
A
[
i
]
=
get_nu_space
()
*
pointwise_multiply
(
G
,
F
[
i
])
+
(
1
-
get_nu_space
())
*
A
[
i
];
A
[
i
]
=
get_nu_space
()
*
pointwise_multiply
(
G
,
F
[
i
])
+
(
1
-
get_nu_space
())
*
A
[
i
];
B
+=
get_nu_space
()
*
(
squared
(
real
(
F
[
i
]))
+
squared
(
imag
(
F
[
i
])));
B
+=
get_nu_space
()
*
(
squared
(
real
(
F
[
i
]))
+
squared
(
imag
(
F
[
i
])));
}
}
return
psr
;
return
psr
;
...
...
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