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
2ba49cd5
Commit
2ba49cd5
authored
Dec 28, 2021
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交计算iou时加入type类型检查
parent
a3b94d41
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
16 deletions
+35
-16
BaseTrack.cpp
BaseTracker/BaseTrack.cpp
+1
-1
BaseTrack.h
BaseTracker/BaseTrack.h
+1
-1
BaseTracker.h
BaseTracker/BaseTracker.h
+14
-14
Track3D.cpp
BaseTracker/Track3D.cpp
+18
-0
Track3D.h
BaseTracker/Track3D.h
+1
-0
No files found.
BaseTracker/BaseTrack.cpp
View file @
2ba49cd5
...
...
@@ -103,7 +103,7 @@ bool BaseTrack::IsValid()
{
return
m_update_count
>=
m_updateValidCount
;
}
int
BaseTrack
::
Get
MeasureData
(
std
::
vector
<
float
>&
data
)
int
BaseTrack
::
Get
IouData
(
std
::
vector
<
float
>&
data
,
int
obj_type
)
{
if
(
kf_
==
nullptr
||
m_num_obs
>
m_num_states
)
return
-
1
;
...
...
BaseTracker/BaseTrack.h
View file @
2ba49cd5
...
...
@@ -30,7 +30,7 @@ public:
virtual
bool
IsLost
();
//数据是否丢失,如果不更新就会丢失
virtual
bool
IsValid
();
//数据是否有效
virtual
int
Get
MeasureData
(
std
::
vector
<
float
>&
data
);
virtual
int
Get
IouData
(
std
::
vector
<
float
>&
data
,
int
obj_type
);
virtual
int
GetIouDataOrder
(
std
::
vector
<
int
>&
order
)
=
0
;
virtual
int
GetKFDataOrder
(
std
::
vector
<
int
>&
order
)
=
0
;
...
...
BaseTracker/BaseTracker.h
View file @
2ba49cd5
...
...
@@ -238,11 +238,12 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
else
{
std
::
vector
<
std
::
vector
<
float
>
>
tracker_states
;
std
::
vector
<
int
>
iouOrder
;
std
::
vector
<
int
>
tracker_type
;
for
(
auto
&
iter
:
tracks
)
{
std
::
vector
<
float
>
measure
;
if
(
iter
.
second
->
GetMeasureData
(
measure
)
==
0
)
int
obj_type
=
0
;
if
(
iter
.
second
->
GetIouData
(
measure
,
obj_type
)
==
0
)
{
tracker_states
.
emplace_back
(
measure
);
}
...
...
@@ -250,14 +251,11 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
{
SDK_LOG
(
SDK_INFO
,
"GetMeasureData failed"
);
}
if
(
iouOrder
.
empty
())
{
iter
.
second
->
GetIouDataOrder
(
iouOrder
);
}
tracker_type
.
push_back
(
obj_type
);
}
int
measure_size
=
_no
;
int
tra_size
=
tracker_states
.
size
()
>
0
?
tracker_states
[
0
].
size
()
:
0
;
if
(
measure
_size
==
0
||
measure_size
!=
tra_size
)
if
(
tra
_size
==
0
||
measure_size
!=
tra_size
)
return
;
int
detect_size
=
detections
.
size
()
*
measure_size
;
int
tracker_size
=
tracker_states
.
size
()
*
tra_size
;
...
...
@@ -276,17 +274,12 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
detect_ptr
.
get
()[
i
*
measure_size
+
j
]
=
out
[
j
];
}
det_type
.
push_back
(
ob_type
);
//for (int j = 0; j < measure_size; j++)
//{
// detect_ptr.get()[i * measure_size + j] = detections[i][iouOrder[j]];
//}
}
for
(
int
i
=
0
;
i
<
tracker_states
.
size
();
i
++
)
{
for
(
int
j
=
0
;
j
<
tra_size
;
j
++
)
{
tracker_ptr
.
get
()[
i
*
tra_size
+
j
]
=
tracker_states
[
i
][
iouOrder
[
j
]
];
tracker_ptr
.
get
()[
i
*
tra_size
+
j
]
=
tracker_states
[
i
][
j
];
}
}
//std::string dete_str = GetMatrixStr(detect_ptr.get(), measure_size, detections.size());
...
...
@@ -301,7 +294,14 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
for
(
int
j
=
0
;
j
<
tracker_states
.
size
();
j
++
)
{
float
*
i_ptr
=
iou_ptr
.
get
();
iou_matrix
[
i
][
j
]
=
i_ptr
[
i
*
tracker_states
.
size
()
+
j
];
if
(
det_type
[
i
]
==
tracker_type
[
j
])
{
iou_matrix
[
i
][
j
]
=
i_ptr
[
i
*
tracker_states
.
size
()
+
j
];
}
else
{
iou_matrix
[
i
][
j
]
=
0
.
0
f
;
}
}
}
...
...
BaseTracker/Track3D.cpp
View file @
2ba49cd5
...
...
@@ -355,6 +355,24 @@ void Track3D::SetValues(std::vector<float>& data)
0
,
0
,
0
,
0
,
0
,
0
,
1
;
}
int
Track3D
::
GetIouData
(
std
::
vector
<
float
>&
data
,
int
obj_type
)
{
if
(
m_obj
==
nullptr
||
kf_
==
nullptr
)
{
return
-
1
;
}
data
.
clear
();
data
.
push_back
(
kf_
->
x
[
0
]);
data
.
push_back
(
kf_
->
x
[
1
]);
data
.
push_back
(
kf_
->
x
[
2
]);
data
.
push_back
(
kf_
->
x
[
4
]);
data
.
push_back
(
kf_
->
x
[
5
]);
data
.
push_back
(
kf_
->
x
[
6
]);
data
.
push_back
(
kf_
->
x
[
3
]);
obj_type
=
m_obj
->
type
;
return
0
;
}
void
Track3D
::
MeasureData
(
const
std
::
vector
<
float
>&
input
,
std
::
vector
<
float
>&
out
,
int
&
obj_type
)
{
...
...
BaseTracker/Track3D.h
View file @
2ba49cd5
...
...
@@ -45,6 +45,7 @@ public:
virtual
void
SetValues
(
std
::
vector
<
float
>&
data
);
virtual
int
GetIouData
(
std
::
vector
<
float
>&
data
,
int
obj_type
);
static
void
MeasureData
(
const
std
::
vector
<
float
>&
input
,
std
::
vector
<
float
>&
out
,
int
&
obj_type
);
trackOjbPtr
m_obj
=
nullptr
;
...
...
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