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
cb1b7264
Commit
cb1b7264
authored
Nov 07, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交跟踪时加入颜色信息的记录。
parent
46cd2214
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
Track3D.cpp
BaseTracker/Track3D.cpp
+29
-0
Track3D.h
BaseTracker/Track3D.h
+5
-0
TrackingRos.cpp
TrackingRos.cpp
+6
-4
No files found.
BaseTracker/Track3D.cpp
View file @
cb1b7264
...
...
@@ -479,4 +479,32 @@ double Track3D::get_acceleration_y(double time_interval){
double
v_0
=
(
m_points
[
n
-
1
].
y
-
m_points
[
n
-
2
].
y
)
/
time_interval
;
double
v_1
=
(
m_points
[
n
-
2
].
y
-
m_points
[
n
-
3
].
y
)
/
time_interval
;
return
(
v_0
-
v_1
)
/
time_interval
;
}
int
Track3D
::
UpdateColorInfo
(
std
::
string
color
)
{
if
(
color
.
empty
()
||
color
==
"unknown"
||
color
==
"null"
||
color
==
"None"
)
return
-
1
;
if
(
m_colorInfos
.
find
(
color
)
==
m_colorInfos
.
end
())
m_colorInfos
[
color
]
=
0
;
m_colorInfos
[
color
]
++
;
return
0
;
}
int
Track3D
::
GetColorInfo
(
std
::
string
&
color
)
{
if
(
m_colorInfos
.
empty
())
{
color
=
"unknown"
;
return
-
1
;
}
int
max
=
0
;
for
(
auto
&
iter
:
m_colorInfos
)
{
if
(
iter
.
second
>
max
)
{
max
=
iter
.
second
;
color
=
iter
.
first
;
}
}
return
0
;
}
\ No newline at end of file
BaseTracker/Track3D.h
View file @
cb1b7264
...
...
@@ -66,6 +66,11 @@ public:
std
::
string
m_number
;
//记录车牌号,出现一次就一直记录
std
::
map
<
std
::
string
,
int
>
m_captureInfos
;
//记录车辆类型检测类型的次数
std
::
map
<
std
::
string
,
int
>
m_colorInfos
;
///< 记录车辆的颜色信息
int
UpdateColorInfo
(
std
::
string
color
);
int
GetColorInfo
(
std
::
string
&
color
);
};
double
correct_angle
(
std
::
vector
<
point2d
>&
points
);
TrackingRos.cpp
View file @
cb1b7264
...
...
@@ -572,7 +572,8 @@ void TrackingRos::ThreadTrackingProcess()
obj
.
obj_id
=
iter
.
first
;
obj
.
acc_x
=
iter
.
second
->
get_acceleration_x
(
0.1
);
obj
.
acc_y
=
iter
.
second
->
get_acceleration_y
(
0.1
);
iter
.
second
->
UpdateColorInfo
(
obj
.
color_name
);
iter
.
second
->
GetColorInfo
(
obj
.
color_name
);
#ifdef _ABUZHABI_
double
lon
=
0.0
f
;
double
lat
=
0.0
f
;
...
...
@@ -654,6 +655,7 @@ void TrackingRos::ThreadTrackingProcess()
obj
.
obj_id
=
iter
.
first
;
obj
.
acc_x
=
iter
.
second
->
get_acceleration_x
(
0.1
);
obj
.
acc_y
=
iter
.
second
->
get_acceleration_y
(
0.1
);
iter
.
second
->
GetColorInfo
(
obj
.
color_name
);
#ifdef _ABUZHABI_
double
lon
=
0.0
f
;
double
lat
=
0.0
f
;
...
...
@@ -808,9 +810,9 @@ void TrackingRos::ThreadTrackingProcess()
t_marker
.
pose
.
orientation
.
y
=
0.0
;
t_marker
.
pose
.
orientation
.
z
=
0.0
;
t_marker
.
pose
.
orientation
.
w
=
1.0
;
t_marker
.
scale
.
x
=
1.5
;
t_marker
.
scale
.
y
=
1.5
;
t_marker
.
scale
.
z
=
1.5
;
t_marker
.
scale
.
x
=
4
;
t_marker
.
scale
.
y
=
4
;
t_marker
.
scale
.
z
=
4
;
t_marker
.
color
.
a
=
1.0
;
t_marker
.
color
.
r
=
0
;
t_marker
.
color
.
g
=
1.0
;
...
...
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