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
73244160
Commit
73244160
authored
Mar 31, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交相机物体的朝向更新
parent
805bef4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
Track3D.cpp
BaseTracker/Track3D.cpp
+15
-9
TrackingRos.cpp
TrackingRos.cpp
+1
-0
No files found.
BaseTracker/Track3D.cpp
View file @
73244160
...
...
@@ -107,9 +107,9 @@ Track3D::Track3D():BaseTrack(10, 7)
}
void
Track3D
::
Init
(
const
std
::
vector
<
float
>&
data
)
{
if
(
data
.
size
()
!=
8
)
if
(
data
.
size
()
!=
9
)
return
;
std
::
vector
<
float
>
tmp
(
data
.
begin
()
+
1
,
data
.
end
()
);
std
::
vector
<
float
>
tmp
(
data
.
begin
()
+
1
,
data
.
begin
()
+
8
);
//修正角度在-PI到PI
while
(
tmp
[
3
]
>
_PI_
)
tmp
[
3
]
-=
2
*
_PI_
;
...
...
@@ -200,9 +200,9 @@ float calcIOU(cv::RotatedRect rect1, cv::RotatedRect rect2) {
double
Track3D
::
CalculateIou
(
const
std
::
vector
<
float
>&
data
)
{
if
(
data
.
size
()
!=
8
)
if
(
data
.
size
()
!=
9
)
{
SDK_LOG
(
SDK_INFO
,
"CalculateIou data size !=
8
"
);
SDK_LOG
(
SDK_INFO
,
"CalculateIou data size !=
9
"
);
return
0.0
f
;
}
if
(
m_obj
==
nullptr
)
...
...
@@ -329,14 +329,15 @@ void Track3D::UpdateDataCheck(const std::vector<float>& data, std::vector<float>
{
if
(
kf_
==
nullptr
)
return
;
if
(
data
.
size
()
!=
8
)
if
(
data
.
size
()
!=
9
)
{
SDK_LOG
(
SDK_INFO
,
"UpdateDataCheck data size is not 8"
);
return
;
}
std
::
vector
<
float
>
tmp
(
data
.
begin
()
+
1
,
data
.
end
()
);
std
::
vector
<
float
>
tmp
(
data
.
begin
()
+
1
,
data
.
begin
()
+
8
);
double
rot_y
=
tmp
[
3
];
if
(
m_points
.
size
()
>=
5
&&
(
abs
(
m_points
[
4
].
x
-
m_points
[
0
].
x
)
>
DIST_THRED
||
abs
(
m_points
[
4
].
y
-
m_points
[
0
].
y
)
>
DIST_THRED
))
int
dataSource
=
data
[
8
];
if
(
dataSource
==
1
&&
m_points
.
size
()
>=
5
&&
(
abs
(
m_points
[
4
].
x
-
m_points
[
0
].
x
)
>
DIST_THRED
||
abs
(
m_points
[
4
].
y
-
m_points
[
0
].
y
)
>
DIST_THRED
))
{
double
center_rot_y
=
correct_angle
(
m_points
);
//SDK_LOG(SDK_INFO, "center_rot_y = %f,rot_y = %f", center_rot_y,rot_y);
...
...
@@ -350,6 +351,11 @@ void Track3D::UpdateDataCheck(const std::vector<float>& data, std::vector<float>
rot_y
+=
_PI_
;
}
}
else
if
(
dataSource
>
1
&&
m_points
.
size
()
>=
5
&&
(
abs
(
m_points
[
4
].
x
-
m_points
[
0
].
x
)
>
DIST_THRED
||
abs
(
m_points
[
4
].
y
-
m_points
[
0
].
y
)
>
DIST_THRED
))
{
double
center_rot_y
=
correct_angle
(
m_points
);
rot_y
=
center_rot_y
;
}
double
x_angle
=
kf_
->
x_
[
3
];
double
deta
=
rot_y
-
x_angle
;
double
deta2
=
rot_y
+
_PI_
-
x_angle
;
...
...
@@ -415,9 +421,9 @@ int Track3D::GetIouData(std::vector<float>& data, int& obj_type)
void
Track3D
::
MeasureIouData
(
const
std
::
vector
<
float
>&
input
,
std
::
vector
<
float
>&
out
,
int
&
obj_type
)
{
if
(
input
.
size
()
!=
8
)
if
(
input
.
size
()
!=
9
)
{
SDK_LOG
(
SDK_INFO
,
"input is not
8
"
);
SDK_LOG
(
SDK_INFO
,
"input is not
9
"
);
return
;
}
obj_type
=
input
[
0
];
...
...
TrackingRos.cpp
View file @
73244160
...
...
@@ -385,6 +385,7 @@ void TrackingRos::ThreadTrackingProcess()
data
.
push_back
(
obj
.
l
);
data
.
push_back
(
obj
.
w
);
data
.
push_back
(
obj
.
h
);
data
.
push_back
(
obj
.
dataSource
);
input
.
emplace_back
(
data
);
}
std
::
vector
<
uint64_t
>
detectionsId
;
...
...
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