Skip to content
Snippets Groups Projects

Update README.md

Merged encinass1u requested to merge Student into main
1 file
+ 40
0
Compare changes
  • Side-by-side
  • Inline
Plotting.py 0 → 100644
+ 40
0
#This code will provide the calcultaion to obtain dicretead data, in order to have coordintes
#and the values inside them corresponding to their height.
import numpy as np
import open3d as o3d
import copy
# Read .ply file, this file contains guassian filter for the surface saved
input_file = "tata_filtered.ply"
pcd = o3d.io.read_point_cloud(input_file) # Read the point cloud
# Convert open3d format to numpy array, the format here is point cloud in numpy format
Pc = np.asarray(pcd.points)
#
Sf = copy.deepcopy(Pc)
L = len(Pc)
iter = 1
#M is the media of surface rugossity, values under it will be 0, over this 1
M = 3.17661
while iter<= L:
for i in range (0,L):
for j in range (2, 3):
if Pc[i,j]> M:
Sf[i,j]=1
else:
Sf[i,j]=0
iter+=1
#Treatment of coordinate to convert them from measurements to coordinates value for a 2D plane.
#For Y
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)
data = np.flip(Dt, axis=0)
print(data)
Loading