上传
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user