Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# frames is a list of mdarrays
new_image = np.zeros(frames[n].shape, dtype=frames[n].dtype)
for ny, y in tqdm(enumerate(flow)):
for nx, flow in enumerate(y):
x_flow, y_flow = flow
new_x = int(nx+x_flow*flow_scaling)
new_y = int(ny+y_flow*flow_scaling)
try:
new_image[new_y][new_x] = frames[n+skiprate][new_y][new_x]
except Exception as ex:
print(ex)
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.