赞
踩
1.python代码:
1 import numpy as np
2 import matplotlib.pyplot as plt
3 from mpl_toolkits.mplot3d import Axes3D
4 #f=open('point cloud.txt','r')
5 f=open('11D-zhongxin1-1_RawXYZ_ds_part2.xyz','r')
6 point=f.read()
7 f.close()
8 l1=point.replace('\n',',')
9 l2=l1.split(',')
10 l2.pop()
11 #print(l2)
12 m1=np.array(l2[0:120000])
13 print(len(m1))
14 #m2=m1.reshape(265565,4)
15 m2=m1.reshape(30000,4)
16 print(m2)
17 m3=[]
18 for each in m2:
19 each_line=list(map(lambda x:float(x),each))
20 m3.append(each_line)
21 m4=np.array(m3)
22
23 x=[k[0] for k in m4]
24 y=[k[1] for k in m4]
25 z=[k[2] for k in m4]
26
27 fig=plt.figure(dpi=120)
28 ax=fi
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。