# coding:utf-8
import open3d as o3d
import numpy as np
def compute_max_local_height_difference(pc, pcd_tree, PPEexec=0, radius=0.2, k=20):
"""
计算给定3D点中每个点的局部最大z方向差
通过在“pts”中查找每个点的z坐标,开始查找点的最大高度差
然后找出这些坐标中的最小值和最大值。
"""
print("determining arg lists...")
sizep = pc.shape[0]
angle_list = []
for pt_idx in range(sizep):
[kk, idx, _] = pcd_tree.search_hybrid_vector_3d(pc[pt_idx], radius, k)
if kk < 3:
# return np.nan
continue
# get the plane of best fit as a point and normal vector [idx[:], :]
# pt, normal = planeFit(data[idx])
heights = pc[idx]
heights = heights[:, 2]
hmax = np.max(heights)
hmin = np.min(heights)
angle_list.a