|
|
@ -174,8 +174,8 @@ output_folder = 'C:\\Users\\Administrator\\Desktop\\BYD\\Visual measurement\\pic
|
|
|
|
# return Z/len(x_bot),-max_Yw
|
|
|
|
# return Z/len(x_bot),-max_Yw
|
|
|
|
|
|
|
|
|
|
|
|
def vs_measurement(txt_name,position):
|
|
|
|
def vs_measurement(txt_name,position):
|
|
|
|
if not os.path.exists(txt_name):
|
|
|
|
# if not os.path.exists(txt_name):
|
|
|
|
return None,None,None,None
|
|
|
|
# return None,None,None,None
|
|
|
|
# 获取数据
|
|
|
|
# 获取数据
|
|
|
|
|
|
|
|
|
|
|
|
x_bot, y_bot, x_top, y_top = get_data.get_data(txt_name)
|
|
|
|
x_bot, y_bot, x_top, y_top = get_data.get_data(txt_name)
|
|
|
@ -183,8 +183,8 @@ def vs_measurement(txt_name,position):
|
|
|
|
y_bot = np.array(y_bot)
|
|
|
|
y_bot = np.array(y_bot)
|
|
|
|
x_top = np.array(x_top)
|
|
|
|
x_top = np.array(x_top)
|
|
|
|
y_top = np.array(y_top)
|
|
|
|
y_top = np.array(y_top)
|
|
|
|
if not (x_bot or y_bot or x_top or y_top):
|
|
|
|
# if not (x_bot or y_bot or x_top or y_top):
|
|
|
|
return 1,1,1,1
|
|
|
|
# return 1,1,1,1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 拟合路沿上下直线方程
|
|
|
|
# 拟合路沿上下直线方程
|
|
|
@ -246,7 +246,7 @@ if __name__ == '__main__':
|
|
|
|
# print(f"x_zero: {x_zero}")
|
|
|
|
# print(f"x_zero: {x_zero}")
|
|
|
|
# print(f"y_zero: {y_zero}")
|
|
|
|
# print(f"y_zero: {y_zero}")
|
|
|
|
t = time.time()
|
|
|
|
t = time.time()
|
|
|
|
Zw_intersection, distance, Zw_pos, distance_pos = vs_measurement(txt_name,1500)
|
|
|
|
Zw_intersection, distance, Zw_pos, distance_pos = vs_measurement(r"C:\Users\Administrator\Desktop\BYD\git\measure_lib\py\new.txt",877)
|
|
|
|
# vs_measurement(txt_name)
|
|
|
|
# vs_measurement(txt_name)
|
|
|
|
print(f"time: {time.time() - t}")
|
|
|
|
print(f"time: {time.time() - t}")
|
|
|
|
print(Zw_intersection, distance, Zw_pos, distance_pos)
|
|
|
|
print(Zw_intersection, distance, Zw_pos, distance_pos)
|