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
286acf27
Commit
286acf27
authored
Jan 04, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交修改
parent
e6f31465
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
trans_data.py
script/trans_data.py
+23
-0
No files found.
script/trans_data.py
View file @
286acf27
...
...
@@ -9,6 +9,8 @@ import shutil as sh
import
copy
from
scipy.spatial.transform
import
Rotation
as
R
import
cv2
from
scipy.spatial
import
Delaunay
import
scipy
def
compute_pitch
(
A
,
B
,
C
):
...
...
@@ -389,6 +391,23 @@ def custom_draw_geometry_with_key_callback(pcd, file_path):
key_to_callback
[
ord
(
"S"
)]
=
save_pcd
o3d
.
visualization
.
draw_geometries_with_key_callbacks
(
pcd
,
key_to_callback
)
def
in_hull
(
p
,
hull
):
"""
:param p: (N, K) test points
:param hull: (M, K) M corners of a box
:return (N) bool
"""
try
:
if
not
isinstance
(
hull
,
Delaunay
):
hull
=
Delaunay
(
hull
)
flag
=
hull
.
find_simplex
(
p
)
>=
0
except
scipy
.
spatial
.
qhull
.
QhullError
:
print
(
'Warning: not a hull
%
s'
%
str
(
hull
))
flag
=
np
.
zeros
(
p
.
shape
[
0
],
dtype
=
np
.
bool
)
return
flag
if
__name__
==
'__main__'
:
root_path
=
"D:/work/git_workspace/jfxmap_python/script/data_aug_samples/"
...
...
@@ -424,8 +443,12 @@ if __name__ == '__main__':
print
(
pcd
)
print
(
converted_pcd
)
xyz
=
np
.
array
(
pcd
.
points
)
merge_geos
=
[
pcd
]
for
bbox
in
bboxes
:
flag
=
in_hull
(
xyz
,
bbox
[
1
])
print
(
xyz
[
flag
])
#渲染bbox
merge_geos
+=
[
gen_o3d_3dbboxes
(
bbox
[
1
])]
heading_point
=
(
bbox
[
3
][
0
]
+
bbox
[
3
][
2
])
/
2
...
...
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