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
5bac71a8
Commit
5bac71a8
authored
Jan 07, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交更新
parent
77ed90d9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
16 deletions
+30
-16
1629734944.471315000.pcd
script/data/10-1/origin/pcds/1629734944.471315000.pcd
+0
-0
1629734945.271462000.pcd
script/data/10-1/origin/pcds/1629734945.271462000.pcd
+0
-0
1629734947.671600000.pcd
script/data/10-1/origin/pcds/1629734947.671600000.pcd
+0
-0
1629734948.471295000.pcd
script/data/10-1/origin/pcds/1629734948.471295000.pcd
+0
-0
trans_data.py
script/trans_data.py
+30
-16
No files found.
script/data/10-1/origin/
10-1_
pcds/1629734944.471315000.pcd
→
script/data/10-1/origin/pcds/1629734944.471315000.pcd
View file @
5bac71a8
File moved
script/data/10-1/origin/
10-1_
pcds/1629734945.271462000.pcd
→
script/data/10-1/origin/pcds/1629734945.271462000.pcd
View file @
5bac71a8
File moved
script/data/10-1/origin/
10-1_
pcds/1629734947.671600000.pcd
→
script/data/10-1/origin/pcds/1629734947.671600000.pcd
View file @
5bac71a8
File moved
script/data/10-1/origin/
10-1_
pcds/1629734948.471295000.pcd
→
script/data/10-1/origin/pcds/1629734948.471295000.pcd
View file @
5bac71a8
File moved
script/trans_data.py
View file @
5bac71a8
...
...
@@ -431,18 +431,29 @@ def read_yaml(path):
if
__name__
==
'__main__'
:
cfg_path
=
"/home/oscar/ros/git/jfxmap_python/7-1.yaml"
cfg
=
read_yaml
(
cfg_path
)
Trans
=
cfg
.
TRACKING
.
TRANS
Trans
=
np
.
array
(
Trans
)
kitti2origin
=
cfg
.
POINTPILLARS
.
KITTI2ORIGIN
kitti2origin
=
np
.
array
(
kitti2origin
)
root_path
=
"/home/oscar/ros/git/jfxmap_python/script/data_aug_samples/"
child_dir
=
"N10_1"
origin_root_path
=
"/home/oscar/ros/git/jfxmap_python/script/data/10-1/"
generate_root_path
=
"/home/oscar/ros/git/jfxmap_python/script/data/5-3/"
origin_child_dir
=
"N10_1"
generate_child_dir
=
"N5_3"
origin_cfg_path
=
origin_root_path
+
"config/10-1.yaml"
origin_cfg
=
read_yaml
(
origin_cfg_path
)
origin_Trans
=
origin_cfg
.
TRACKING
.
TRANS
origin_Trans
=
np
.
array
(
origin_Trans
)
origin_kitti2origin
=
origin_cfg
.
POINTPILLARS
.
KITTI2ORIGIN
origin_kitti2origin
=
np
.
array
(
origin_kitti2origin
)
generate_cfg_path
=
generate_root_path
+
"config/5-3.yaml"
generate_cfg
=
read_yaml
(
generate_cfg_path
)
generate_Trans
=
generate_cfg
.
TRACKING
.
TRANS
generate_Trans
=
np
.
array
(
generate_Trans
)
generate_kitti2origin
=
generate_cfg
.
POINTPILLARS
.
KITTI2ORIGIN
generate_kitti2origin
=
np
.
array
(
generate_kitti2origin
)
#读标注的json文件
anno
=
{}
jsn_file
=
os
.
path
.
join
(
root_path
,
child_dir
+
".json"
)
jsn_file
=
os
.
path
.
join
(
origin_root_path
,
"origin/"
+
origin_
child_dir
+
".json"
)
print
(
jsn_file
)
p_dir
=
"/home/oscar/ros/git/catkin_ws_xishan/src/jfx_traffic_events/thirdparty/jfxmap/"
...
...
@@ -450,13 +461,16 @@ if __name__ == '__main__':
ret
=
init_jfxmap
(
p_dir
,
f_path
)
print
(
ret
)
base_file_path
=
os
.
path
.
join
(
generate_root_path
,
"base/1633640721.417269000.pcd"
)
g_xyzi
,
g_pcd
,
g_converted_pcd
=
parse_pandarmind_pcd
(
base_file_path
,
rotMat
[
generate_child_dir
])
vis
=
True
with
open
(
jsn_file
,
'r'
,
encoding
=
'utf-8'
,
errors
=
'ignore'
)
as
fp
:
jsn
=
json
.
load
(
fp
)
annos
=
jsn
[
"annotations"
]
for
an
in
annos
:
fileuri
=
"
10-1_
pcds/"
+
an
[
'fileuri'
]
.
split
(
"/"
)[
-
1
]
fileuri_path
=
os
.
path
.
join
(
root_path
,
fileuri
)
fileuri
=
"
origin/
pcds/"
+
an
[
'fileuri'
]
.
split
(
"/"
)[
-
1
]
fileuri_path
=
os
.
path
.
join
(
origin_
root_path
,
fileuri
)
# print(fileuri_path)
if
os
.
path
.
isfile
(
fileuri_path
):
print
(
fileuri_path
,
" "
,
fileuri
)
...
...
@@ -472,7 +486,7 @@ if __name__ == '__main__':
# print(bbox_flag)
# print(bboxes)
# 地面转成水平面,地面点的z值几乎差不多
xyzi
,
pcd
,
converted_pcd
=
parse_pandarmind_pcd
(
file_path
,
rotMat
[
child_dir
])
xyzi
,
pcd
,
converted_pcd
=
parse_pandarmind_pcd
(
file_path
,
rotMat
[
origin_
child_dir
])
print
(
xyzi
)
print
(
pcd
)
print
(
converted_pcd
)
...
...
@@ -482,7 +496,7 @@ if __name__ == '__main__':
drawpointcloud
=
[]
merge_geos
=
[
pcd
]
for
bbox
in
bboxes
:
lidar_loc
,
out_BL
,
out_center_BL
=
get_loc
([
bbox
[
4
][
0
],
bbox
[
4
][
1
],
bbox
[
4
][
2
],
bbox
[
6
][
0
],
bbox
[
6
][
1
],
bbox
[
6
][
2
],
bbox
[
2
]],
0
,
Trans
,
kitti2origin
)
lidar_loc
,
out_BL
,
out_center_BL
=
get_loc
([
bbox
[
4
][
0
],
bbox
[
4
][
1
],
bbox
[
4
][
2
],
bbox
[
6
][
0
],
bbox
[
6
][
1
],
bbox
[
6
][
2
],
bbox
[
2
]],
0
,
origin_Trans
,
origin_
kitti2origin
)
print
(
out_center_BL
)
angle
=
bbox
[
2
]
/
np
.
pi
*
180
isInMap
=
get_map_data
(
out_center_BL
[
0
],
out_center_BL
[
1
],
angle
)
...
...
@@ -519,8 +533,8 @@ if __name__ == '__main__':
merge_geos
+=
[
axis_pcd
]
drawpointcloud
+=
[
axis_pcd
]
#pcd.paint_uniform_color([1.00, 0, 0])
savefile
=
"D:/pointcloud"
+
str
(
num
)
+
".pcd"
o3d
.
io
.
write_point_cloud
(
savefile
,
savecloud
)
#
savefile = "D:/pointcloud" + str(num) + ".pcd"
#
o3d.io.write_point_cloud(savefile,savecloud)
num
+=
1
# custom_draw_geometry_with_key_callback(merge_geos, file_path)
custom_draw_geometry_with_key_callback
(
drawpointcloud
,
file_path
)
...
...
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