Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
School_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
encinass1u
School_project
Merge requests
!2
Update README.md
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update README.md
Student
into
main
Overview
0
Commits
51
Pipelines
0
Changes
1
Merged
encinass1u
requested to merge
Student
into
main
3 years ago
Overview
0
Commits
51
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
832b94b2
Prev
Next
Show latest version
1 file
+
44
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
832b94b2
SMATed surface file
· 832b94b2
encinass1u
authored
3 years ago
Plotting_3_levels.py
0 → 100644
+
44
−
0
Options
import
numpy
as
np
import
open3d
as
o3d
import
copy
# Read .ply file
input_file
=
"
tata_filtered.ply
"
pcd
=
o3d
.
io
.
read_point_cloud
(
input_file
)
# Read the point cloud
# Visualize the point cloud within open3d
# o3d.visualization.draw_geometries([pcd])
# Convert open3d format to numpy array
# Here, you have the point cloud in numpy format.
Pc
=
np
.
asarray
(
pcd
.
points
)
#Sf for surface
Sf
=
copy
.
deepcopy
(
Pc
)
#Legnth of Points cloud Pc
L
=
len
(
Pc
)
iter
=
1
#Limits that will define the division between the 3 levels
M1
=
3.16287333
M2
=
3.18335667
#Loop to arrange the values to their corresponding height from -1 to 1
while
iter
<=
L
:
for
i
in
range
(
0
,
L
):
for
j
in
range
(
2
,
3
):
if
Pc
[
i
,
j
]
<=
M1
:
Sf
[
i
,
j
]
=-
1
elif
Pc
[
i
,
j
]
<=
M2
:
Sf
[
i
,
j
]
=
0
else
:
Sf
[
i
,
j
]
=
1
iter
+=
1
#Treatment of coordinate to convert them from measurements to coordinates value for a 2D plane.
Dt
=
copy
.
deepcopy
(
Sf
)
for
i
in
range
(
0
,
L
):
for
j
in
range
(
1
,
2
):
Dt
[
i
,
j
]
=
-
int
((
Sf
[
i
,
j
]
+
21.8168
)
/
0.0052
)
#For X
for
i
in
range
(
0
,
L
):
for
j
in
range
(
0
,
1
):
Dt
[
i
,
j
]
=
-
int
((
Sf
[
i
,
j
]
+
8.445706367
)
/
0.005214
)
#Order the array of values Y axis from mayor to minor.
data_3
=
np
.
flip
(
Dt
,
axis
=
0
)
\ No newline at end of file
Loading