This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# 车胎横向分界线
k=0.62849534
b=21.8122503
"""
读取yolo网络识别路沿的坐标数据,筛选出目标区域的数据点,并将路沿上下侧数据分离
参数:保存数据的txt文件路径
返回值:在目标区域内的下侧数据点坐标x_bot、y_bot,上侧数据点坐标x_top,y_top
"""
defget_data(txt_name):
withopen(txt_name,'r',encoding='utf-8')asf:
lines=f.readlines()
data=[]
fori,lineinenumerate(lines,1):
data.append(line.split())
# print(line.split())
x_bot=[]
y_bot=[]
x_top=[]
y_top=[]
k_num=0
foriinrange(len(data)):
data[i][1]=960-int(data[i][1])
foriinrange(len(data)):
# if k * int(data[i][0]) + b - int(data[i][1]) < 0: