- 博客(8)
- 收藏
- 关注
原创 根据标签对点云可视化
使用mayavi库import mayavi.mlabimport numpy as npdata = np.loadtxt('points9_label.txt', dtype=np.float64)x = data[:, 0]y = data[:, 1]z = data[:, 2]max = np.max(data[:, 3])for i in data: i[...
2020-05-04 20:58:35
568
原创 ValueError: When changing to a larger dtype解决办法
ValueError: When changing to a larger dtype, its size must be a divisor of the total size in bytes of the last axis of the array在执行下面代码时出错,经查阅,发现numpy的ndarry形式可能是Fortran-style 也可能是C-style,这两种数组的行与列的表...
2020-04-16 13:39:07
4541
原创 python 使用numpy求二维数组的差集
import numpy as npa1 = np.asarray([[1,2,3],[3,4,5],[4,5,6]])a2 = np.asarray([[1,2,3], [3,4,5]])print(a1)print(a2)a1_rows = a1.view([('', a1.dtype)] * a1.shape[1])a2_rows = a2.view([('', a2.dtype...
2020-04-15 17:33:39
5552
5
翻译 python读取点云.ply文件
官方github网址:https://github.com/dranjan/python-plyfile安装plyfile库:pip install plyfile使用 plydata = PlyData.read('tet.ply')或with open('tet.ply', 'rb') as f:... plydata = PlyData.read(f)...
2020-03-21 18:56:22
9304
7
原创 python实现点云文件las格式转txt格式
需要numpy和laspy库,使用pcloud将f中需要的属性提取成nupmy数组,将RGB的值归一化成0-255之间,最后保存import numpy as npfrom laspy import filef = file.File('Tile_+012_+010.las', mode='r')pcloud = np.vstack((f.X, f.Y, f.Z, f.Red, f.Gr...
2020-03-14 21:08:00
3568
6
原创 TypeError: only size-1 arrays can be converted to Python scalars解决办法
def ori_point(points): if len(points) == 1: origin = points[0] else: xyzmean = np.mean(np.array(points), axis=0) distances = np.sqrt(np.sum(np.asarray(xyzmean - points)...
2020-03-12 19:21:30
3936
原创 numpy计算一个点到其余点的欧氏距离
distances = np.sqrt(np.sum(np.asarray(xyzmean - points) ** 2, axis=1))xyzmean是单独一个点,points是点的集合生成的distances是一个距离的一维数组
2020-03-12 18:55:34
2857
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人