代码地址
代码
attn_param = np.load(attn_path) # local atention coefficients局部张量系数
flow_field = np.load(flow_path) # the corresponding flow fields相应的流场
visi=np.zeros((flow_field.shape[1],flow_field.shape[2]))
x_start, x_end, y_start, y_end = get_rectangle() # obtain the positions of red rectangle获取红色矩形的位置
kz = int(attn_param.shape[0]**0.5)
size = int(kz/2)
for x in range(x_start, x_end):
for y in range(y_start, y_end):
offset = flow_field[:,y,x]
delta_x = (x+offset[0]-math.floor(x+offset[0])) # the bilinear sampling双线性采样 parameter
delta_y &