【发布时间】:2021-08-27 08:10:05
【问题描述】:
我正在尝试使用 numpy 过滤点云。
我将所有内容都转换为 numpy 数组。
verts = np.asarray (points.get_vertices (2)). reshape (h, w, 3)
现在我会喜欢只查看某个 xmin、xmax 范围内的值。或者也可以是 xmin、xmax、ymin、ymax。
I tried the following for the x filter
verts = np.asarray(points.get_vertices(2)).reshape(h, w, 3)
texcoords = np.asarray(points.get_texture_coordinates(2))
xmin = -0.25
xmax = 0.25
ymin = 0.0
ymax = 1.0
inidx = np.all(np.logical_and(xmin <= verts, verts <= xmax), axis=0)
inbox = verts[inidx]
print(verts.length, inbox.length)
但我已经在这里收到一条错误消息
IndexError: boolean index did not match indexed array along dimension 1; dimension is 212 but corresponding boolean dimension is 3
【问题讨论】: