|
|
@ -23,7 +23,7 @@ def grid_downsample(points, cell_size=15):
|
|
|
|
参数:保存数据的txt文件路径
|
|
|
|
参数:保存数据的txt文件路径
|
|
|
|
返回值:在目标区域内的下侧数据点坐标x_bot、y_bot,上侧数据点坐标x_top,y_top
|
|
|
|
返回值:在目标区域内的下侧数据点坐标x_bot、y_bot,上侧数据点坐标x_top,y_top
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
def get_data(txt_name):
|
|
|
|
def get_data(txt_name,jingdu):
|
|
|
|
# 加载数据
|
|
|
|
# 加载数据
|
|
|
|
data = np.loadtxt(txt_name)
|
|
|
|
data = np.loadtxt(txt_name)
|
|
|
|
int_data = data.astype(int)
|
|
|
|
int_data = data.astype(int)
|
|
|
@ -144,7 +144,7 @@ def get_data(txt_name):
|
|
|
|
clean_slope_bot, clean_intercept_bot, clean_r2_bot = calc_slope_line.linear_regression(x_bot_clean, y_bot_clean)
|
|
|
|
clean_slope_bot, clean_intercept_bot, clean_r2_bot = calc_slope_line.linear_regression(x_bot_clean, y_bot_clean)
|
|
|
|
clean_slope_top, clean_intercept_top, clean_r2_top = calc_slope_line.linear_regression(x_top_clean, y_top_clean)
|
|
|
|
clean_slope_top, clean_intercept_top, clean_r2_top = calc_slope_line.linear_regression(x_top_clean, y_top_clean)
|
|
|
|
print(f"清洗数据后上下沿拟合参数clean_r2_bot = {clean_r2_bot},clean_r2_top = {clean_r2_top}")
|
|
|
|
print(f"清洗数据后上下沿拟合参数clean_r2_bot = {clean_r2_bot},clean_r2_top = {clean_r2_top}")
|
|
|
|
if ((1-clean_r2_bot) > (1-0.98)) or ((1-clean_r2_top) > (1-0.98)):
|
|
|
|
if ((1-clean_r2_bot) > (1-jingdu)) or ((1-clean_r2_top) > (1-jingdu)):
|
|
|
|
print("无效数据")
|
|
|
|
print("无效数据")
|
|
|
|
return 0, None, None, None, None
|
|
|
|
return 0, None, None, None, None
|
|
|
|
return 1, x_bot_clean, y_bot_clean, x_top_clean, y_top_clean
|
|
|
|
return 1, x_bot_clean, y_bot_clean, x_top_clean, y_top_clean
|
|
|
|