This commit is contained in:
cdeyw
2025-08-13 11:42:19 +08:00
parent 92778fa76a
commit b3f417fb3f
10 changed files with 2226 additions and 20702 deletions

View File

@ -144,8 +144,8 @@ def out_bounds_dete(pm_y, pm_x, piont_y, piont_x):
def remove_nan_mean_value(pm, y, x, iter_max=50):
y, x = out_bounds_dete(pm.shape[0], pm.shape[1], y, x)
point_x, point_y, point_z = pm[y, x]
if np.isnan(point_x):
point_x, point_y, point_z = pm[y, x]#得到这个位置的点云的坐标
if np.isnan(point_x):#如果这个位置是nan找到周围50个像素的范围内的点云并求平均来代替这个点的坐标
point_x_list = []
point_y_list = []
point_z_list = []
@ -154,7 +154,7 @@ def remove_nan_mean_value(pm, y, x, iter_max=50):
pm_shape_x = pm.shape[1]
remove_nan_isok = False
print('Nan值去除')
while iter_current < iter_max:
while iter_current < iter_max:#这个邻域内不是nan的点就被放到列表中
# 计算开始点
if y - iter_current > 0:
y_start = y - iter_current
@ -180,7 +180,7 @@ def remove_nan_mean_value(pm, y, x, iter_max=50):
point_z_list.append(pm[y_current, x_current][2])
len_point_x = len(point_x_list)
if len_point_x > 0:
if len_point_x > 0:#计算x,y,z的均值
point_x = sum(point_x_list)/len_point_x
point_y = sum(point_y_list)/len_point_x
point_z = sum(point_z_list)/len_point_x