Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_src
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
oscar
jfx_kalman_filter_src
Commits
6a733931
Commit
6a733931
authored
Dec 27, 2021
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交修改
parent
2c1d0c39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
BaseTracker.h
BaseTracker/BaseTracker.h
+6
-6
TrackingRos.cpp
TrackingRos.cpp
+2
-1
No files found.
BaseTracker/BaseTracker.h
View file @
6a733931
...
...
@@ -29,7 +29,7 @@ public:
void
SetValidUpdateCount
(
int
count
){
m_updateValidCount
=
count
;
}
void
SetValues
(
std
::
vector
<
float
>&
values
)
{
m_values
=
values
;
}
int
Run
(
const
std
::
vector
<
std
::
vector
<
float
>
>&
detections
,
std
::
vector
<
uint64_t
>&
detectionsId
,
std
::
map
<
uint64_t
,
int
>&
updateId
,
std
::
vector
<
uint64_t
>&
lostId
);
int
Run
(
const
std
::
vector
<
std
::
vector
<
float
>
>&
detections
,
int
_no
/*观测数量*/
,
int
_ns
/*状态数量*/
,
std
::
vector
<
uint64_t
>&
detectionsId
,
std
::
map
<
uint64_t
,
int
>&
updateId
,
std
::
vector
<
uint64_t
>&
lostId
);
std
::
map
<
uint64_t
,
std
::
shared_ptr
<
T
>
>
GetStates
();
...
...
@@ -53,7 +53,7 @@ public:
template
<
class
T
>
int
BaseTracker
<
T
>::
Run
(
const
std
::
vector
<
std
::
vector
<
float
>
>&
detections
,
std
::
vector
<
uint64_t
>&
detectionsId
,
std
::
map
<
uint64_t
,
int
>&
updateId
,
std
::
vector
<
uint64_t
>&
lostId
)
int
BaseTracker
<
T
>::
Run
(
const
std
::
vector
<
std
::
vector
<
float
>
>&
detections
,
int
_no
/*观测数量*/
,
int
_ns
/*状态数量*/
,
std
::
vector
<
uint64_t
>&
detectionsId
,
std
::
map
<
uint64_t
,
int
>&
updateId
,
std
::
vector
<
uint64_t
>&
lostId
)
{
/*** Predict internal tracks from previous frame ***/
for
(
auto
&
track
:
m_tracker
)
...
...
@@ -74,7 +74,7 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, std:
std
::
vector
<
int
>
unmatched_det
;
// return values - matched, unmatched_det
AssociateDetectionsToTrackers
(
detections
,
m_tracker
,
matched
,
unmatched_det
);
AssociateDetectionsToTrackers
(
detections
,
_no
,
_ns
,
m_tracker
,
matched
,
unmatched_det
);
/*** Update tracks with associated bbox ***/
if
(
m_isGPU
==
0
)
...
...
@@ -93,7 +93,7 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, std:
if
(
bs
>
0
)
{
int
ns
=
0
;
int
no
=
detections
.
size
()
>
0
?
detections
[
0
].
size
()
:
0
;
int
no
=
_no
;
std
::
shared_ptr
<
float
>
Z
=
std
::
shared_ptr
<
float
>
(
new
float
[
bs
*
no
],
[](
float
*
p
)
{
if
(
p
)
delete
[]
p
;
p
=
nullptr
;
});
std
::
shared_ptr
<
float
*>
X
=
std
::
shared_ptr
<
float
*>
(
new
float
*
[
bs
],
[](
float
**
p
)
{
if
(
p
)
delete
[]
p
;
p
=
nullptr
;
});
std
::
shared_ptr
<
float
*>
P
=
std
::
shared_ptr
<
float
*>
(
new
float
*
[
bs
],
[](
float
**
p
)
{
if
(
p
)
delete
[]
p
;
p
=
nullptr
;
});
...
...
@@ -185,7 +185,7 @@ std::map<uint64_t, std::shared_ptr<T> > BaseTracker<T>::GetStates()
}
template
<
class
T
>
void
BaseTracker
<
T
>::
AssociateDetectionsToTrackers
(
const
std
::
vector
<
std
::
vector
<
float
>
>&
detections
,
std
::
map
<
uint64_t
,
std
::
shared_ptr
<
T
>
>&
tracks
,
std
::
map
<
uint64_t
,
int
>&
matched
,
std
::
vector
<
int
>&
unmatched_det
)
void
BaseTracker
<
T
>::
AssociateDetectionsToTrackers
(
const
std
::
vector
<
std
::
vector
<
float
>
>&
detections
,
int
_no
/*观测数量*/
,
int
_ns
/*状态数量*/
,
std
::
map
<
uint64_t
,
std
::
shared_ptr
<
T
>
>&
tracks
,
std
::
map
<
uint64_t
,
int
>&
matched
,
std
::
vector
<
int
>&
unmatched_det
)
{
if
(
tracks
.
empty
())
{
...
...
@@ -255,7 +255,7 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
iter
.
second
->
GetIouDataOrder
(
iouOrder
);
}
}
int
measure_size
=
detections
.
size
()
>
0
?
detections
[
0
].
size
()
:
0
;
int
measure_size
=
_no
;
int
tra_size
=
tracker_states
.
size
()
>
0
?
tracker_states
[
0
].
size
()
:
0
;
if
(
measure_size
==
0
||
measure_size
!=
tra_size
)
return
;
...
...
TrackingRos.cpp
View file @
6a733931
...
...
@@ -300,6 +300,7 @@ void TrackingRos::ThreadTrackingProcess()
{
jfx_common_msgs
::
det_tracking
&
obj
=
objsPtr
->
array
[
i
];
std
::
vector
<
float
>
data
;
data
.
push_back
(
obj
.
type
);
data
.
push_back
(
obj
.
x
);
//x对应经度
data
.
push_back
(
obj
.
y
);
//y对应纬度
data
.
push_back
(
obj
.
z
);
...
...
@@ -314,7 +315,7 @@ void TrackingRos::ThreadTrackingProcess()
std
::
vector
<
uint64_t
>
lostId
;
uint64_t
begin
=
GetCurTime
();
m_tracker
.
Run
(
input
,
detectionsId
,
updateId
,
lostId
);
m_tracker
.
Run
(
input
,
7
,
10
,
detectionsId
,
updateId
,
lostId
);
uint64_t
rTime
=
GetCurTime
()
-
begin
;
//SDK_LOG(SDK_INFO, "m_tracker.Run time = %llu", rTime);
std
::
map
<
uint64_t
,
std
::
shared_ptr
<
Track3D
>
>
trackers
=
m_tracker
.
GetStates
();
...
...
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