Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfxmap_python
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
jfxmap_python
Commits
01432cd8
Commit
01432cd8
authored
Feb 09, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交参数整理,可以方便修改
parent
0fa52f5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
trans_and_export_data_multi_auto.py
script/trans_and_export_data_multi_auto.py
+24
-9
No files found.
script/trans_and_export_data_multi_auto.py
View file @
01432cd8
...
...
@@ -485,12 +485,21 @@ def InitCarYawAngle():
InitCarYawAngle
()
####################下面是可以调节的参数#################
Thread_NUM
=
10
#启动几个线程处理数据
car_car_distance_ratio
=
1.0
#车与车之间间距系数,范围 > 0.5, 数据越小车间距越小,最小为0.5
max_cloud_boxes_num
=
30
#每帧点云放入多少个车辆时可以保存点云数据了,不需要放入很多的车辆。
need_save_cloud_list_max
=
100
#处理队列数量多少时,开始检查保存点云数据,其中还需要参数来做判断
min_cloud_boxes_num
=
5
#当队列达到need_save_cloud_list_max数量之后,需要判断点云中车辆数据大于多少就保存。
must_save_cloud_list_max_limit
=
200
#当队列达到多少数量需要强行保存点云数据,为了避免队列无限大。
lane_car_angle
=
30
#道路和车辆朝向夹角小于多少认为符合要求
MAX_SAVE_FILE_NUM
=
10000
# 每个空点云最多生成多少帧点云数据
#######################################################
g_saveFileType
=
1
#0为pcd文件,1是bin文件
g_showCloud
=
0
#0不显示,1显示
g_pcd_info
=
{}
g_no_save_count
=
0
g_save_count
=
0
MAX_SAVE_FILE_NUM
=
10000
g_thread_lock
=
threading
.
Lock
()
g_map_lock
=
threading
.
Lock
()
...
...
@@ -570,12 +579,17 @@ def Add_Cloud_box(save_cloud,add_idx,bbox,pickcloud,json,dir_g):
def
Check_Add_Cloud_box
(
save_cloud
,
bbox
,
pcd
,
pcdName
,
path
,
index
):
global
g_save_count
global
car_car_distance_ratio
global
max_cloud_boxes_num
global
need_save_cloud_list_max
global
min_cloud_boxes_num
global
must_save_cloud_list_max_limit
add_idx
=
-
1
for
cloud_idx
,
cloud
in
enumerate
(
save_cloud
):
#查找可以添加的点云
interactive
=
0
for
box
in
cloud
[
"boxes"
]:
if
abs
(
bbox
[
4
][
0
]
-
box
[
4
][
0
])
<
(
bbox
[
6
][
0
]
+
box
[
6
][
0
])
and
abs
(
bbox
[
4
][
1
]
-
box
[
4
][
1
])
<
(
bbox
[
6
][
0
]
+
box
[
6
][
0
])
:
if
abs
(
bbox
[
4
][
0
]
-
box
[
4
][
0
])
<
(
bbox
[
6
][
0
]
+
box
[
6
][
0
])
*
car_car_distance_ratio
and
abs
(
bbox
[
4
][
1
]
-
box
[
4
][
1
])
<
(
bbox
[
6
][
0
]
+
box
[
6
][
0
])
*
car_car_distance_ratio
:
interactive
=
1
if
interactive
==
1
:
continue
...
...
@@ -584,13 +598,13 @@ def Check_Add_Cloud_box(save_cloud,bbox,pcd,pcdName,path,index):
break
;
if
add_idx
==
-
1
:
#需要保存数据了
if
index
==
1
and
len
(
save_cloud
)
>=
100
and
len
(
save_cloud
[
0
][
"boxes"
])
>=
5
:
if
index
==
1
and
len
(
save_cloud
)
>=
need_save_cloud_list_max
and
len
(
save_cloud
[
0
][
"boxes"
])
>=
min_cloud_boxes_num
:
save_cloud
[
0
][
"isSave"
]
=
1
elif
index
==
1
and
len
(
save_cloud
)
>
0
and
len
(
save_cloud
[
0
][
"boxes"
])
>
30
:
elif
index
==
1
and
len
(
save_cloud
)
>
0
and
len
(
save_cloud
[
0
][
"boxes"
])
>
max_cloud_boxes_num
:
save_cloud
[
0
][
"isSave"
]
=
1
elif
index
==
1
and
len
(
save_cloud
)
>=
200
:
elif
index
==
1
and
len
(
save_cloud
)
>=
must_save_cloud_list_max_limit
:
save_cloud
[
0
][
"isSave"
]
=
1
max_cloud_list_num
=
200
max_cloud_list_num
=
must_save_cloud_list_max_limit
if
add_idx
==
-
1
:
if
len
(
save_cloud
)
<
max_cloud_list_num
:
new_cloud
=
{}
...
...
@@ -605,7 +619,7 @@ def Check_Add_Cloud_box(save_cloud,bbox,pcd,pcdName,path,index):
print
(
" save_cloud is too big > "
,
max_cloud_list_num
)
return
add_idx
Thread_NUM
=
10
threads
=
[]
threadID
=
1
...
...
@@ -632,6 +646,7 @@ class pcdThread (threading.Thread):
global
g_saveFileType
global
g_map_lock
global
car_yaw_cal_angle
global
lane_car_angle
print
(
"开启线程:"
+
self
.
name
)
isStop
=
0
index
=
self
.
begin
...
...
@@ -685,7 +700,7 @@ class pcdThread (threading.Thread):
while
detaAngel
<
-
180
:
detaAngel
+=
360
# print("angle = ",angle2," laneAngle = ",laneAngle," detaAngel = ",detaAngel)
if
bbox
[
0
]
!=
"pedestrian"
and
abs
(
detaAngel
)
>
30
:
if
bbox
[
0
]
!=
"pedestrian"
and
abs
(
detaAngel
)
>
lane_car_angle
:
continue
if
bbox
[
0
]
==
"pedestrian"
and
isInCross
==
0
:
continue
...
...
@@ -862,7 +877,7 @@ if __name__ == '__main__':
t
.
join
()
for
_ind
,
cloud_i
in
enumerate
(
save_cloud_list
):
for
cloud
in
cloud_i
:
if
len
(
cloud
[
"boxes"
])
>=
10
:
if
len
(
cloud
[
"boxes"
])
>=
min_cloud_boxes_num
:
Save_Cloud_File
(
cloud
,
save_json_list
[
_ind
],
dir_g
)
for
t_idx
in
save_json_list
:
for
jsn
in
t_idx
:
...
...
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